Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion lib/mpl_toolkits/axisartist/tests/test_axis_artist.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,9 @@ def test_axis_artist():
for loc in ('left', 'right', 'bottom'):
helper = AxisArtistHelperRectlinear.Fixed(ax, loc=loc)
axisline = AxisArtist(ax, helper, offset=None, axis_direction=loc)
axisline.major_ticks.set_tick_direction("in")
axisline.major_ticks.set_tick_direction({
"left": "in", "right": "out", "bottom": "inout",
}[loc])
ax.add_artist(axisline)

# Settings for bottom AxisArtist.
Expand Down
24 changes: 6 additions & 18 deletions lib/mpl_toolkits/axisartist/tests/test_axislines.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,8 @@
from mpl_toolkits.axisartist import Axes, SubplotHost


# TODO: tighten tolerance after baseline image is regenerated for text overhaul
@image_comparison(['SubplotZero.png'], style='default', tol=0.02)
@image_comparison(['SubplotZero.png'], style='mpl20')
def test_SubplotZero():
# Remove this line when this test image is regenerated.
plt.rcParams.update({"xtick.direction": "in", "ytick.direction": "in"})

fig = plt.figure()

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


# TODO: tighten tolerance after baseline image is regenerated for text overhaul
@image_comparison(['Subplot.png'], style='default', tol=0.02)
@image_comparison(['Subplot.png'], style='mpl20')
def test_Subplot():
Comment thread
QuLogic marked this conversation as resolved.
# Remove this line when this test image is regenerated.
plt.rcParams.update({"xtick.direction": "in", "ytick.direction": "in"})

fig = plt.figure()

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

ax.axis["top"].major_ticks.set_tick_out(True)
ax.axis["bottom"].major_ticks.set_tick_out(True)
ax.axis["left"].major_ticks.set_tick_out(False)
ax.axis["right"].major_ticks.set_tick_out(False)

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

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


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


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

Expand Down
13 changes: 2 additions & 11 deletions lib/mpl_toolkits/axisartist/tests/test_floating_axes.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,8 @@ def test_subplot():
fig.add_subplot(ax)


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

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


# Rather high tolerance to allow ongoing work with floating axes internals;
# remove when image is regenerated.
@image_comparison(['curvelinear4.png'], style='default', tol=0.9)
@image_comparison(['curvelinear4.png'], style='mpl20')
def test_curvelinear4():
# Remove this line when this test image is regenerated.
plt.rcParams.update({"xtick.direction": "in", "ytick.direction": "in"})

fig = plt.figure(figsize=(5, 5))

tr = (mtransforms.Affine2D().scale(np.pi / 180, 1) +
Expand Down
17 changes: 5 additions & 12 deletions lib/mpl_toolkits/axisartist/tests/test_grid_helper_curvelinear.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,9 @@
GridHelperCurveLinear


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

class MyTransform(Transform):
input_dims = output_dims = 2
Expand Down Expand Up @@ -79,11 +78,9 @@ def inverted(self):
ax1.grid(True)


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

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


# Remove tol when this test image is regenerated.
@image_comparison(['axis_direction.png'], style='default', tol=0.15)
@image_comparison(['axis_direction.png'], style='mpl20')
def test_axis_direction():
# Remove this line when this test image is regenerated.
plt.rcParams.update({"xtick.direction": "in", "ytick.direction": "in"})

fig = plt.figure(figsize=(5, 5))

# PolarAxes.PolarTransform takes radian. However, we want our coordinate
Expand Down
Loading