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

Function plot_axis

galleries/examples/ticks/date_formatters_locators.py:24–37  ·  view source on GitHub ↗

Set up common parameters for the Axes in the example.

(ax, locator=None, xmax='2002-02-01', fmt=None, formatter=None)

Source from the content-addressed store, hash-verified

22
23
24def plot_axis(ax, locator=None, xmax='2002-02-01', fmt=None, formatter=None):
25 """Set up common parameters for the Axes in the example."""
26 ax.spines[['left', 'right', 'top']].set_visible(False)
27 ax.yaxis.set_major_locator(ticker.NullLocator())
28 ax.tick_params(which='major', width=1.00, length=5)
29 ax.tick_params(which='minor', width=0.75, length=2.5)
30 ax.set_xlim(np.datetime64('2000-02-01'), np.datetime64(xmax))
31 if locator:
32 ax.xaxis.set_major_locator(eval(locator))
33 ax.xaxis.set_major_formatter(DateFormatter(fmt))
34 else:
35 ax.xaxis.set_major_formatter(eval(formatter))
36 ax.text(0.0, 0.2, locator or formatter, transform=ax.transAxes,
37 fontsize=14, fontname='Monospace', color='tab:blue')
38
39# %%
40# :ref:`date-locators`

Callers 1

Calls 7

DateFormatterClass · 0.90
set_visibleMethod · 0.45
set_major_locatorMethod · 0.45
tick_paramsMethod · 0.45
set_xlimMethod · 0.45
set_major_formatterMethod · 0.45
textMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…