|
43 | 43 | # (e.g., ``xlocator='log'``), to draw ticks every ``N`` data values with |
44 | 44 | # :class:`~matplotlib.ticker.MultipleLocator` (e.g., ``xlocator=2``), or to tick the |
45 | 45 | # specific locations in a list using :class:`~matplotlib.ticker.FixedLocator` (just |
46 | | -# like :func:`~matplotlib.axes.Axes.set_xticks` and :func:`~matplotlib.axes.Axes.set_yticks`). |
| 46 | +# like :meth:`~matplotlib.axes.Axes.set_xticks` and :meth:`~matplotlib.axes.Axes.set_yticks`). |
47 | 47 | # If you want to work with the locator classes directly, they are available in the |
48 | 48 | # top-level namespace (e.g., ``xlocator=uplt.MultipleLocator(...)`` is allowed). |
49 | 49 | # |
50 | 50 | # To generate lists of tick locations, we recommend using UltraPlot's |
51 | 51 | # :func:`~ultraplot.utils.arange` function -- it’s basically an endpoint-inclusive |
52 | | -# version of `numpy.arange`, which is usually what you'll want in this context. |
| 52 | +# version of :func:`~numpy.arange`, which is usually what you'll want in this context. |
53 | 53 |
|
54 | 54 | # %% |
55 | 55 | import ultraplot as uplt |
|
116 | 116 | # You can use these keyword arguments to apply built-in matplotlib |
117 | 117 | # :class:`~matplotlib.ticker.Formatter`\ s by their "registered" names |
118 | 118 | # (e.g., ``xformatter='log'``), to apply a ``%``-style format directive with |
119 | | -# `~matplotlib.ticker.FormatStrFormatter` (e.g., ``xformatter='%.0f'``), or |
120 | | -# to apply custom tick labels with `~matplotlib.ticker.FixedFormatter` (just |
121 | | -# like :func:`~matplotlib.axes.Axes.set_xticklabels`). You can also apply one of UltraPlot's |
| 119 | +# :class:`~matplotlib.ticker.FormatStrFormatter` (e.g., ``xformatter='%.0f'``), or |
| 120 | +# to apply custom tick labels with :class:`~matplotlib.ticker.FixedFormatter` (just |
| 121 | +# like :meth:`~matplotlib.axes.Axes.set_xticklabels`). You can also apply one of UltraPlot's |
122 | 122 | # new tick formatters -- for example, ``xformatter='deglat'`` to label ticks |
123 | 123 | # as geographic latitude coordinates, ``xformatter='pi'`` to label ticks as |
124 | 124 | # fractions of :math:`\pi`, or ``xformatter='sci'`` to label ticks with |
|
253 | 253 | # unit, use a unit string (e.g., ``xlocator='month'``). To draw ticks every ``N`` time |
254 | 254 | # units, use a (unit, N) tuple (e.g., ``xlocator=('day', 5)``). For `% style formatting |
255 | 255 | # <https://docs.python.org/3/library/datetime.html#strftime-strptime-behavior>`__ |
256 | | -# of datetime tick labels with :func:`~datetime.datetime.strftime`, you can use a string |
| 256 | +# of datetime tick labels with :meth:`~datetime.datetime.strftime`, you can use a string |
257 | 257 | # containing ``'%'`` (e.g. ``xformatter='%Y-%m-%d'``). By default, *x* axis datetime |
258 | 258 | # axis labels are rotated 90 degrees, like in `pandas`_. This can be disabled by |
259 | 259 | # passing ``xrotation=0`` to :func:`~ultraplot.axes.CartesianAxes.format` or by setting |
|
337 | 337 | # (shorthand `xloc`), `xtickloc`, `xticklabelloc`, and `xlabelloc`. Valid |
338 | 338 | # locations include ``'left'``, ``'right'``, ``'top'``, ``'bottom'``, ``'neither'``, |
339 | 339 | # ``'none'``, or ``'both'``. Spine locations can also be set to a valid |
340 | | -# :func:`~matplotlib.spines.Spine.set_position` value, e.g. ``'zero'`` or |
| 340 | +# :meth:`~matplotlib.spines.Spine.set_position` value, e.g. ``'zero'`` or |
341 | 341 | # ``('axes', 1.5)``. The top or right spine is used when the coordinate is |
342 | 342 | # more than halfway across the axes. This is often convenient when passing |
343 | 343 | # e.g. `loc` to :ref:`"alternate" axes commands <ug_alt>`. These keywords |
344 | | -# provide the functionality of matplotlib's :func:`~matplotlib.axis.YAxis.tick_left`, |
345 | | -# :func:`~matplotlib.axis.YAxis.tick_right`, :func:`~matplotlib.axis.XAxis.tick_top`, and |
346 | | -# :func:`~matplotlib.axis.XAxis.tick_bottom`, and :func:`~matplotlib.spines.Spine.set_position`, |
| 344 | +# provide the functionality of matplotlib's :meth:`~matplotlib.axis.YAxis.tick_left`, |
| 345 | +# :meth:`~matplotlib.axis.YAxis.tick_right`, :meth:`~matplotlib.axis.XAxis.tick_top`, and |
| 346 | +# :meth:`~matplotlib.axis.XAxis.tick_bottom`, and :meth:`~matplotlib.spines.Spine.set_position`, |
347 | 347 | # but with additional flexibility. |
348 | 348 |
|
349 | 349 | # %% |
|
392 | 392 | # :func:`~ultraplot.axes.CartesianAxes.format`. |
393 | 393 | # * To make its behavior consistent with :class:`~ultraplot.constructor.Locator` and |
394 | 394 | # :class:`~ultraplot.constructor.Formatter`, the :class:`~ultraplot.constructor.Scale` |
395 | | -# constructor function returns instances of `~matplotlib.scale.ScaleBase`, |
396 | | -# and :func:`~matplotlib.axes.Axes.set_xscale` and |
397 | | -# :func:`~matplotlib.axes.Axes.set_yscale` now accept these class instances in |
| 395 | +# constructor function returns instances of :class:`~matplotlib.scale.ScaleBase`, |
| 396 | +# and :meth:`~matplotlib.axes.Axes.set_xscale` and |
| 397 | +# :meth:`~matplotlib.axes.Axes.set_yscale` now accept these class instances in |
398 | 398 | # addition to "registered" names like ``'log'``. |
399 | 399 | # * While matplotlib axis scales must be instantiated with an |
400 | 400 | # :class:`~matplotlib.axis.Axis` instance (for backwards compatibility reasons), |
|
406 | 406 | # `subs` rather than keywords with trailing ``x`` or ``y``. |
407 | 407 | # |
408 | 408 | # UltraPlot also includes a few new axis scales. The ``'cutoff'`` scale |
409 | | -# `~ultraplot.scale.CutoffScale` is useful when the statistical distribution |
410 | | -# of your data is very unusual. The ``'sine'`` scale `~ultraplot.scale.SineLatitudeScale` |
| 409 | +# :class:`~ultraplot.scale.CutoffScale` is useful when the statistical distribution |
| 410 | +# of your data is very unusual. The ``'sine'`` scale :class:`~ultraplot.scale.SineLatitudeScale` |
411 | 411 | # scales the axis with a sine function (resulting in an area-weighted spherical latitude |
412 | | -# coordinate) and the ``'mercator'`` scale `~ultraplot.scale.MercatorLatitudeScale` |
| 412 | +# coordinate) and the ``'mercator'`` scale :class:`~ultraplot.scale.MercatorLatitudeScale` |
413 | 413 | # scales the axis with the Mercator projection latitude coordinate. The |
414 | | -# ``'inverse'`` scale `~ultraplot.scale.InverseScale` can be useful when |
| 414 | +# ``'inverse'`` scale :class:`~ultraplot.scale.InverseScale` can be useful when |
415 | 415 | # working with spectral data, especially with :ref:`"dual" unit axes <ug_dual>`. |
416 | 416 | # If you want to work with the axis scale classes directly, they are available |
417 | 417 | # in the top-level namespace (e.g., ``xscale=uplt.CutoffScale(...)`` is allowed). |
|
545 | 545 | # Alternate axes |
546 | 546 | # -------------- |
547 | 547 | # |
548 | | -# The `matplotlib.axes.Axes` class includes :func:`~matplotlib.axes.Axes.twinx` |
549 | | -# and :func:`~matplotlib.axes.Axes.twiny` commands for drawing "twin" *x* and |
| 548 | +# The :class:`~matplotlib.axes.Axes` class includes :meth:`~matplotlib.axes.Axes.twinx` |
| 549 | +# and :meth:`~matplotlib.axes.Axes.twiny` commands for drawing "twin" *x* and |
550 | 550 | # *y* axes in the same subplot. UltraPlot expands on these commands and adds |
551 | 551 | # the arguably more intuitive :func:`~ultraplot.axes.CartesianAxes.altx` and |
552 | 552 | # :func:`~ultraplot.axes.CartesianAxes.alty` options. Here :func:`~ultraplot.axes.CartesianAxes.altx` |
|
0 commit comments