Set up common parameters for the Axes in the example.
(ax, locator=None, xmax='2002-02-01', fmt=None, formatter=None)
| 22 | |
| 23 | |
| 24 | def 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` |
no test coverage detected
searching dependent graphs…