Skip to content

Commit a66c671

Browse files
committed
TST: add a test
1 parent 90334ba commit a66c671

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

lib/matplotlib/tests/test_scale.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
from matplotlib.scale import (
33
LogTransform, InvertedLogTransform,
44
SymmetricalLogTransform)
5+
import matplotlib.scale as mscale
56
from matplotlib.testing.decorators import check_figures_equal, image_comparison
67

78
import numpy as np
@@ -198,3 +199,14 @@ def forward(x):
198199
ax.plot(x, x)
199200
ax.set_xscale('function', functions=(forward, inverse))
200201
ax.set_xlim(1, 1000)
202+
203+
204+
def test_pass_scale():
205+
# test passing a scale object works...
206+
fig, ax = plt.subplots()
207+
scale = mscale.LogScale(axis=None)
208+
ax.set_xscale(scale)
209+
scale = mscale.LogScale(axis=None)
210+
ax.set_yscale(scale)
211+
assert ax.xaxis.get_scale() == 'log'
212+
assert ax.yaxis.get_scale() == 'log'

0 commit comments

Comments
 (0)