Skip to content

Commit 834f6a0

Browse files
authored
Merge branch 'master' into better-packaging
2 parents 0c83167 + 85d40d0 commit 834f6a0

File tree

4 files changed

+26
-2
lines changed

4 files changed

+26
-2
lines changed

matplotlib2tikz/axes.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,10 @@ def _get_ticks(data, xy, ticks, ticklabels):
389389
pgfplots_ticks.append(tick)
390390
# store the label anyway
391391
label = ticklabel.get_text()
392-
pgfplots_ticklabels.append(label)
392+
if ticklabel.get_visible():
393+
pgfplots_ticklabels.append(label)
394+
else:
395+
is_label_required = True
393396
# Check if the label is necessary. If one of the labels is, then all
394397
# of them must appear in the TikZ plot.
395398
if label:

test/testfunctions/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
'quadmesh',
2828
'scatter',
2929
'scatter_colormap',
30+
'sharex_and_y',
3031
'subplots',
3132
'subplot4x4',
3233
'subplots_with_colorbars',

test/testfunctions/legends2.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#
33
desc = 'Multiple legend positions'
44
# phash = 'd558f444f0542bbb'
5-
phash = '55d47cd472d4892b'
5+
phash = '55d454d47ed4892b'
66

77

88
def plot():

test/testfunctions/sharex_and_y.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# -*- coding: utf-8 -*-
2+
#
3+
desc = 'Tick label visibility with sharex and sharey'
4+
phash = '9bed5812ff11a892'
5+
6+
7+
def plot():
8+
from matplotlib import pyplot as pp
9+
import numpy as np
10+
11+
fig, axes = pp.subplots(2, 2, sharex=True, sharey=True, figsize=(8, 5))
12+
t = np.arange(0.0, 5.0, 0.01)
13+
s = np.cos(2 * np.pi * t)
14+
15+
axes[0][0].plot(t, s, color='blue')
16+
axes[0][1].plot(t, s, color='red')
17+
axes[1][0].plot(t, s, color='green')
18+
axes[1][1].plot(t, s, color='black')
19+
20+
return fig

0 commit comments

Comments
 (0)