Skip to content

Commit 2057583

Browse files
committed
Drop axis_artist tickdir image compat, due to text-overhaul merge.
Also replace style='default' by style='mpl20'.
1 parent eee6586 commit 2057583

File tree

4 files changed

+16
-42
lines changed

4 files changed

+16
-42
lines changed

lib/mpl_toolkits/axisartist/tests/test_axis_artist.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,9 @@ def test_axis_artist():
8383
for loc in ('left', 'right', 'bottom'):
8484
helper = AxisArtistHelperRectlinear.Fixed(ax, loc=loc)
8585
axisline = AxisArtist(ax, helper, offset=None, axis_direction=loc)
86-
axisline.major_ticks.set_tick_direction("in")
86+
axisline.major_ticks.set_tick_direction({
87+
"left": "in", "right": "out", "bottom": "inout",
88+
}[loc])
8789
ax.add_artist(axisline)
8890

8991
# Settings for bottom AxisArtist.

lib/mpl_toolkits/axisartist/tests/test_axislines.py

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,8 @@
77
from mpl_toolkits.axisartist import Axes, SubplotHost
88

99

10-
# TODO: tighten tolerance after baseline image is regenerated for text overhaul
11-
@image_comparison(['SubplotZero.png'], style='default', tol=0.02)
10+
@image_comparison(['SubplotZero.png'], style='mpl20')
1211
def test_SubplotZero():
13-
# Remove this line when this test image is regenerated.
14-
plt.rcParams.update({"xtick.direction": "in", "ytick.direction": "in"})
15-
1612
fig = plt.figure()
1713

1814
ax = SubplotZero(fig, 1, 1, 1)
@@ -29,12 +25,8 @@ def test_SubplotZero():
2925
ax.set_ylabel("Test")
3026

3127

32-
# TODO: tighten tolerance after baseline image is regenerated for text overhaul
33-
@image_comparison(['Subplot.png'], style='default', tol=0.02)
28+
@image_comparison(['Subplot.png'], style='mpl20')
3429
def test_Subplot():
35-
# Remove this line when this test image is regenerated.
36-
plt.rcParams.update({"xtick.direction": "in", "ytick.direction": "in"})
37-
3830
fig = plt.figure()
3931

4032
ax = Subplot(fig, 1, 1, 1)
@@ -44,8 +36,8 @@ def test_Subplot():
4436
ax.plot(xx, np.sin(xx))
4537
ax.set_ylabel("Test")
4638

47-
ax.axis["top"].major_ticks.set_tick_out(True)
48-
ax.axis["bottom"].major_ticks.set_tick_out(True)
39+
ax.axis["left"].major_ticks.set_tick_out(False)
40+
ax.axis["right"].major_ticks.set_tick_out(False)
4941

5042
ax.axis["bottom"].set_label("Tk0")
5143

@@ -60,9 +52,8 @@ def test_Axes():
6052

6153

6254
@image_comparison(['ParasiteAxesAuxTrans_meshplot.png'],
63-
remove_text=True, style='default', tol=0.075)
55+
remove_text=True, style='mpl20', tol=0.075)
6456
def test_ParasiteAxesAuxTrans():
65-
# Remove this line when this test image is regenerated.
6657
plt.rcParams.update({"xtick.direction": "in", "ytick.direction": "in"})
6758
data = np.ones((6, 6))
6859
data[2, 2] = 2
@@ -140,11 +131,8 @@ def test_axisline_style_tight():
140131
ax.axis[direction].set_visible(False)
141132

142133

143-
# TODO: tighten tolerance after baseline image is regenerated for text overhaul
144-
@image_comparison(['subplotzero_ylabel.png'], style='mpl20', tol=0.02)
134+
@image_comparison(['subplotzero_ylabel.png'], style='mpl20')
145135
def test_subplotzero_ylabel():
146-
# Remove this line when this test image is regenerated.
147-
plt.rcParams.update({"xtick.direction": "in", "ytick.direction": "in"})
148136
fig = plt.figure()
149137
ax = fig.add_subplot(111, axes_class=SubplotZero)
150138

lib/mpl_toolkits/axisartist/tests/test_floating_axes.py

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,8 @@ def test_subplot():
1919
fig.add_subplot(ax)
2020

2121

22-
# Rather high tolerance to allow ongoing work with floating axes internals;
23-
# remove when image is regenerated.
24-
@image_comparison(['curvelinear3.png'], style='default', tol=5)
22+
@image_comparison(['curvelinear3.png'], style='mpl20')
2523
def test_curvelinear3():
26-
# Remove this line when this test image is regenerated.
27-
plt.rcParams.update({"xtick.direction": "in", "ytick.direction": "in"})
2824
fig = plt.figure(figsize=(5, 5))
2925

3026
tr = (mtransforms.Affine2D().scale(np.pi / 180, 1) +
@@ -67,13 +63,8 @@ def test_curvelinear3():
6763
l.set_clip_path(ax1.patch)
6864

6965

70-
# Rather high tolerance to allow ongoing work with floating axes internals;
71-
# remove when image is regenerated.
72-
@image_comparison(['curvelinear4.png'], style='default', tol=0.9)
66+
@image_comparison(['curvelinear4.png'], style='mpl20')
7367
def test_curvelinear4():
74-
# Remove this line when this test image is regenerated.
75-
plt.rcParams.update({"xtick.direction": "in", "ytick.direction": "in"})
76-
7768
fig = plt.figure(figsize=(5, 5))
7869

7970
tr = (mtransforms.Affine2D().scale(np.pi / 180, 1) +

lib/mpl_toolkits/axisartist/tests/test_grid_helper_curvelinear.py

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,9 @@
1515
GridHelperCurveLinear
1616

1717

18-
@image_comparison(['custom_transform.png'], style='default', tol=0.2)
18+
@image_comparison(['custom_transform.png'], style='mpl20', tol=0.2)
1919
def test_custom_transform():
20-
# Remove this line when this test image is regenerated.
21-
plt.rcParams.update({"xtick.direction": "in", "ytick.direction": "in"})
20+
plt.rcParams.update({"xtick.direction": "in", "ytick.direction": "inout"})
2221

2322
class MyTransform(Transform):
2423
input_dims = output_dims = 2
@@ -79,11 +78,9 @@ def inverted(self):
7978
ax1.grid(True)
8079

8180

82-
# TODO: tighten tolerance after baseline image is regenerated for text overhaul
83-
@image_comparison(['polar_box.png'], style='default', tol=0.09)
81+
@image_comparison(['polar_box.png'], style='mpl20')
8482
def test_polar_box():
85-
# Remove this line when this test image is regenerated.
86-
plt.rcParams.update({"xtick.direction": "in", "ytick.direction": "in"})
83+
plt.rcParams.update({"xtick.direction": "inout", "ytick.direction": "out"})
8784
fig = plt.figure(figsize=(5, 5))
8885

8986
# PolarAxes.PolarTransform takes radian. However, we want our coordinate
@@ -141,12 +138,8 @@ def test_polar_box():
141138
ax1.grid(True)
142139

143140

144-
# Remove tol when this test image is regenerated.
145-
@image_comparison(['axis_direction.png'], style='default', tol=0.15)
141+
@image_comparison(['axis_direction.png'], style='mpl20')
146142
def test_axis_direction():
147-
# Remove this line when this test image is regenerated.
148-
plt.rcParams.update({"xtick.direction": "in", "ytick.direction": "in"})
149-
150143
fig = plt.figure(figsize=(5, 5))
151144

152145
# PolarAxes.PolarTransform takes radian. However, we want our coordinate

0 commit comments

Comments
 (0)