MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / test_formatter_ticker

Function test_formatter_ticker

lib/matplotlib/tests/test_axes.py:244–280  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

242@image_comparison([f'formatter_ticker_{i:03d}.png' for i in range(1, 6)], style='mpl20',
243 tol=0.03 if sys.platform == 'darwin' else 0)
244def test_formatter_ticker():
245 import matplotlib.testing.jpl_units as units
246 units.register()
247
248 # This should not affect the tick size. (Tests issue #543)
249 matplotlib.rcParams['lines.markeredgewidth'] = 30
250
251 # This essentially test to see if user specified labels get overwritten
252 # by the auto labeler functionality of the axes.
253 xdata = [x*units.sec for x in range(10)]
254 ydata1 = [(1.5*y - 0.5)*units.km for y in range(10)]
255 ydata2 = [(1.75*y - 1.0)*units.km for y in range(10)]
256
257 ax = plt.figure().subplots()
258 ax.set_xlabel("x-label 001")
259
260 ax = plt.figure().subplots()
261 ax.set_xlabel("x-label 001")
262 ax.plot(xdata, ydata1, color='blue', xunits="sec")
263
264 ax = plt.figure().subplots()
265 ax.set_xlabel("x-label 001")
266 ax.plot(xdata, ydata1, color='blue', xunits="sec")
267 ax.set_xlabel("x-label 003")
268
269 ax = plt.figure().subplots()
270 ax.plot(xdata, ydata1, color='blue', xunits="sec")
271 ax.plot(xdata, ydata2, color='green', xunits="hour")
272 ax.set_xlabel("x-label 004")
273
274 # See SF bug 2846058
275 # https://sourceforge.net/tracker/?func=detail&aid=2846058&group_id=80706&atid=560720
276 ax = plt.figure().subplots()
277 ax.plot(xdata, ydata1, color='blue', xunits="sec")
278 ax.plot(xdata, ydata2, color='green', xunits="hour")
279 ax.set_xlabel("x-label 005")
280 ax.autoscale_view()
281
282
283def test_funcformatter_auto_formatter():

Callers

nothing calls this directly

Calls 6

figureMethod · 0.80
set_xlabelMethod · 0.80
registerMethod · 0.45
subplotsMethod · 0.45
plotMethod · 0.45
autoscale_viewMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…