Locators¶
Set your own ticks before or after apply or range_frame; the frame keeps them and still decides where the spine ends.
To place ticks yourself (QuartileLocator, FeatureLocator, or any matplotlib locator) set it before or after apply or range_frame: on a single axes the frame keeps whichever locator you installed, rather than overwriting it. small_multiples and shared axes are the exception, since they compute a shared scale that owns the ticks instead. The two take the same arguments, so everything here holds for either. The frame mode still decides where the spine ends, now reading your ticks, since the frame follows the axes at every draw: nice and loose bound it to your outermost ticks, data to the data's extent. That is how the resonance figure holds its spine at 16–19 while the curve spills past.
Linear, log and date axes are handled; set the scale before calling range_frame, and plot date data first, since an axis only becomes a date axis once dates arrive on it. On a log axis the ticks sit on powers of the base and the minor ticks disappear with them; ax.xaxis.set_minor_locator(matplotlib.ticker.LogLocator(subs="auto")) brings the minors back. On a date axis the ticks sit on calendar starts (a year, a month, a day, an hour) and the labels shorten to what changes between ticks, so a run of months does not repeat the year. That shared year sits at the right end of the bottom spine, where xlabel goes, and stacks above an xlabel if you set one. The calendar steps the locator chooses among are not exposed; for a fixed step, set one of matplotlib's date locators before or after apply, mdates.YearLocator(10) say, and the frame reads it. Anything else (symlog, logit, categorical axes) is left untouched with a warning. The warning covers the frame and ticks only; line_labels places its labels on any scale.
The locators that ship with the library each answer one question. QuartileLocator ticks the minimum, quartiles and maximum, the five-number summary, as in the Anscombe figure. SummaryLocator ticks any reducers of one axis's values, the slowest, median and fastest winner in the grand tours. FeatureLocator ticks features of an x, y pair, a peak's own frequency in the resonance figure. TalbotLocator, LogBreaksLocator and DateBreaksLocator are the defaults range_frame installs for linear, log and date axes, and can be used on their own with any matplotlib axes. The reference has every argument.