Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions docs/1dplots.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
# 1D plotting commands
# ====================
#
# ultraplot adds :ref:`several new features <why_plotting>` to matplotlib's
# UltraPlot adds :ref:`several new features <why_plotting>` to matplotlib's
# plotting commands using the intermediate `~ultraplot.axes.PlotAxes` class.
# For the most part, these additions represent a *superset* of matplotlib -- if
# you are not interested, you can use the plotting commands just like you would
Expand Down Expand Up @@ -54,7 +54,7 @@
# .. note::
#
# By default, when choosing the *x* or *y* axis limits,
# ultraplot ignores out-of-bounds data along the other axis if it was explicitly
# UltraPlot ignores out-of-bounds data along the other axis if it was explicitly
# fixed by `~matplotlib.axes.Axes.set_xlim` or `~matplotlib.axes.Axes.set_ylim` (or,
# equivalently, by passing `xlim` or `ylim` to `ultraplot.axes.CartesianAxes.format`).
# This can be useful if you wish to restrict the view along a "dependent" variable
Expand Down Expand Up @@ -157,7 +157,7 @@
# ``ax.plot(y='y', data=dataset)`` are translated to ``ax.plot(dataset['y'])``.
# This is the preferred input style for most `seaborn`_ plotting commands.
# Also, if you pass a `pint.Quantity` or `~xarray.DataArray`
# containing a `pint.Quantity`, ultraplot will automatically call
# containing a `pint.Quantity`, UltraPlot will automatically call
# `~pint.UnitRegistry.setup_matplotlib` so that the axes become unit-aware.

# %%
Expand Down Expand Up @@ -510,7 +510,7 @@
# expressed with the `width` keyword. Note that bar widths can also be passed
# as a third positional argument.
# Additionally, matplotlib bar widths are always expressed in data units,
# while ultraplot bar widths are expressed in step size-relative units by
# while UltraPlot bar widths are expressed in step size-relative units by
# default. For example, ``width=1`` with a dependent coordinate step
# size of ``2`` fills 100% of the space between each bar rather than 50%. This
# can be disabled by passing ``absolute_width=True`` to `~ultraplot.axes.Axes.bar`
Expand Down
18 changes: 9 additions & 9 deletions docs/2dplots.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
# 2D plotting commands
# ====================
#
# ultraplot adds :ref:`several new features <why_plotting>` to matplotlib's
# UltraPlot adds :ref:`several new features <why_plotting>` to matplotlib's
# plotting commands using the intermediate `~ultraplot.axes.PlotAxes` class.
# For the most part, these additions represent a *superset* of matplotlib -- if
# you are not interested, you can use the plotting commands just like you would
Expand All @@ -34,7 +34,7 @@
#
# .. important::
#
# By default, ultraplot automatically adjusts the width of
# By default, UltraPlot automatically adjusts the width of
# `~ultraplot.axes.PlotAxes.contourf` and `~ultraplot.axes.PlotAxes.pcolor` edges
# to eliminate the appearance of `"white lines" in saved vector graphic files
# <https://github.com/jklymak/contourfIssues>`__. However, this can significantly
Expand Down Expand Up @@ -67,7 +67,7 @@
# .. note::
#
# By default, when choosing the colormap :ref:`normalization
# range <ug_apply_cmap>`, ultraplot ignores data outside the *x* or *y* axis
# range <ug_apply_cmap>`, UltraPlot ignores data outside the *x* or *y* axis
# limits if they were previously fixed by `~matplotlib.axes.Axes.set_xlim` or
# `~matplotlib.axes.Axes.set_ylim` (or, equivalently, by passing `xlim` or
# `ylim` to `ultraplot.axes.CartesianAxes.format`). This can be useful if you
Expand Down Expand Up @@ -180,7 +180,7 @@
# ``ax.plot(y='y', data=dataset)`` are translated to ``ax.plot(dataset['y'])``.
# This is the preferred input style for most `seaborn`_ plotting commands.
# Also, if you pass a `pint.Quantity` or `~xarray.DataArray`
# containing a `pint.Quantity`, ultraplot will automatically call
# containing a `pint.Quantity`, UltraPlot will automatically call
# `~pint.UnitRegistry.setup_matplotlib` so that the axes become unit-aware.

# %%
Expand Down Expand Up @@ -252,7 +252,7 @@
# You can also create on-the-fly "qualitative" `~ultraplot.colors.DiscreteColormap`\ s
# by passing lists of colors to the keyword `c`, `color`, or `colors`.
#
# ultraplot defines :ref:`global defaults <ug_rc>` for four different colormap
# UltraPlot defines :ref:`global defaults <ug_rc>` for four different colormap
# types: :ref:`sequential <ug_cmaps_included>` (setting :rcraw:`cmap.sequential`),
# :ref:`diverging <ug_cmaps_included>` (setting :rcraw:`cmap.diverging`),
# :ref:`cyclic <ug_cmaps_included>` (setting :rcraw:`cmap.cyclic`),
Expand Down Expand Up @@ -347,7 +347,7 @@
# Special normalizers
# -------------------
#
# ultraplot includes two new :ref:`"continuous" normalizers <ug_norm>`. The
# UltraPlot includes two new :ref:`"continuous" normalizers <ug_norm>`. The
# `~ultraplot.colors.SegmentedNorm` normalizer provides even color gradations with respect
# to index for an arbitrary monotonically increasing or decreasing list of levels. This
# is automatically applied if you pass unevenly spaced `levels` to a plotting command,
Expand Down Expand Up @@ -429,7 +429,7 @@
# Discrete levels
# ---------------
#
# By default, ultraplot uses `~ultraplot.colors.DiscreteNorm` to "discretize"
# By default, UltraPlot uses `~ultraplot.colors.DiscreteNorm` to "discretize"
# the possible colormap colors for contour and pseudocolor `~ultraplot.axes.PlotAxes`
# commands (e.g., `~ultraplot.axes.PlotAxes.contourf`, `~ultraplot.axes.PlotAxes.pcolor`).
# This is analogous to `matplotlib.colors.BoundaryNorm`, except
Expand Down Expand Up @@ -529,7 +529,7 @@
#
# By default, colormaps are normalized to span from roughly the minimum
# data value to the maximum data value. However in the presence of outliers,
# this is not desirable. ultraplot adds the `robust` keyword to change this
# this is not desirable. UltraPlot adds the `robust` keyword to change this
# behavior, inspired by the `xarray keyword
# <http://xarray.pydata.org/en/stable/user-guide/plotting.html#robust>`__
# of the same name. Passing ``robust=True`` to a `~ultraplot.axes.PlotAxes`
Expand All @@ -543,7 +543,7 @@
#
# Additionally, `similar to xarray
# <http://xarray.pydata.org/en/stable/user-guide/plotting.html#colormaps>`__,
# ultraplot can automatically detect "diverging" datasets. By default,
# UltraPlot can automatically detect "diverging" datasets. By default,
# the 2D `~ultraplot.axes.PlotAxes` commands will apply the diverging colormap
# :rc:`cmap.diverging` (rather than :rc:`cmap.sequential`) and the diverging
# normalizer `~ultraplot.colors.DivergingNorm` (rather than `~matplotlib.colors.Normalize`
Expand Down
28 changes: 14 additions & 14 deletions docs/basics.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@
# Creating figures
# ----------------
#
# ultraplot works by `subclassing
# UltraPlot works by `subclassing
# <https://docs.python.org/3/tutorial/classes.html#inheritance>`__
# three fundamental matplotlib classes: `ultraplot.figure.Figure` replaces
# `matplotlib.figure.Figure`, `ultraplot.axes.Axes` replaces `matplotlib.axes.Axes`,
# three fundamental matplotlib classes: :class:`ultraplot.figure.Figure` replaces
# :class:`matplotlib.figure.Figure`, :class:`ultraplot.axes.Axes` replaces :class:`matplotlib.axes.Axes`,
# and `ultraplot.gridspec.GridSpec` replaces `matplotlib.gridspec.GridSpec`
# (see this `tutorial
# <https://matplotlib.org/stable/tutorials/intermediate/gridspec.html>`__
Expand All @@ -44,11 +44,11 @@
# %% [raw] raw_mimetype="text/restructuredtext"
# .. note::
#
# ultraplot changes the default :rcraw:`figure.facecolor`
# UltraPlot changes the default :rcraw:`figure.facecolor`
# so that the figure backgrounds shown by the `matplotlib backend
# <https://matplotlib.org/faq/usage_faq#what-is-a-backend>`__ are light gray
# (the :rcraw:`savefig.facecolor` applied to saved figures is still white).
# ultraplot also controls the appearance of figures in Jupyter notebooks
# UltraPlot also controls the appearance of figures in Jupyter notebooks
# using the new :rcraw:`inlineformat` setting, which is passed to
# `~ultraplot.config.config_inline_backend` on import. This
# imposes a higher-quality default `"inline" format
Expand All @@ -57,7 +57,7 @@
# ``InlineBackend.print_figure_kwargs``, ensuring that the figures you save
# look like the figures displayed by the backend.
#
# ultraplot also changes the default :rcraw:`savefig.format`
# UltraPlot also changes the default :rcraw:`savefig.format`
# from PNG to PDF for the following reasons:
#
# #. Vector graphic formats are infinitely scalable.
Expand All @@ -67,7 +67,7 @@
# #. The EPS format is outdated and does not support transparent graphic
# elements.
#
# In case you *do* need a raster format like PNG, ultraplot increases the
# In case you *do* need a raster format like PNG, UltraPlot increases the
# default :rcraw:`savefig.dpi` to 1000 dots per inch, which is
# `recommended <https://www.pnas.org/page/authors/format>`__ by most journals
# as the minimum resolution for figures containing lines and text. See the
Expand Down Expand Up @@ -98,7 +98,7 @@
# `ultraplot.axes.Axes`. To add subplots all at once, use
# `ultraplot.figure.Figure.add_subplots` (or its shorthand,
# `ultraplot.figure.Figure.subplots`). Note that under the hood, the top-level
# ultraplot command `~ultraplot.ui.subplots` simply calls `~ultraplot.ui.figure`
# UltraPlot command `~ultraplot.ui.subplots` simply calls `~ultraplot.ui.figure`
# followed by `ultraplot.figure.Figure.add_subplots`.
#
# * With no arguments, `~ultraplot.figure.Figure.add_subplots` returns a subplot
Expand Down Expand Up @@ -135,7 +135,7 @@
#
# .. warning::
#
# ultraplot employs :ref:`automatic axis sharing <ug_share>` by default. This lets
# UltraPlot employs :ref:`automatic axis sharing <ug_share>` by default. This lets
# subplots in the same row or column share the same axis limits, scales, ticks,
# and labels. This is often convenient, but may be annoying for some users. To
# keep this feature turned off, simply :ref:`change the default settings <ug_rc>`
Expand Down Expand Up @@ -232,7 +232,7 @@
# -----------------
#
# If you create subplots all-at-once with e.g. `~ultraplot.ui.subplots`,
# ultraplot returns a `~ultraplot.gridspec.SubplotGrid` of subplots. This list-like,
# UltraPlot returns a `~ultraplot.gridspec.SubplotGrid` of subplots. This list-like,
# array-like object provides some useful features and unifies the behavior of the
# three possible return types used by `matplotlib.pyplot.subplots`:
#
Expand Down Expand Up @@ -307,8 +307,8 @@
# a python-style object-oriented interface with axes-level commands
# like `matplotlib.axes.Axes.plot`, and a MATLAB-style `~matplotlib.pyplot` interface
# with global commands like `matplotlib.pyplot.plot` that track the "current" axes.
# ultraplot builds upon the python-style interface using the `ultraplot.axes.PlotAxes`
# class. Since every axes used by ultraplot is a child of `~ultraplot.axes.PlotAxes`, we
# UltraPlot builds upon the python-style interface using the `ultraplot.axes.PlotAxes`
# class. Since every axes used by UltraPlot is a child of `~ultraplot.axes.PlotAxes`, we
# are able to add features directly to the axes-level commands rather than relying
# on a separate library of commands (note that while some of these features may be
# accessible via `~matplotlib.pyplot` commands, this is not officially supported).
Expand Down Expand Up @@ -368,7 +368,7 @@
# that tracks current axes and provides global commands like
# `matplotlib.pyplot.title`.
#
# ultraplot provides the ``format`` command as an
# UltraPlot provides the ``format`` command as an
# alternative "python-style" command for formatting a variety of plot elements.
# While matplotlib's one-liner commands still work, ``format`` only needs to be
# called once and tends to cut down on boilerplate code. You can call
Expand Down Expand Up @@ -477,7 +477,7 @@
# :ref:`ultraplot settings <ug_rcultraplot>`. The matplotlib-specific settings are
# stored in `~ultraplot.config.rc_matplotlib` (our name for `matplotlib.rcParams`) and
# the ultraplot-specific settings are stored in `~ultraplot.config.rc_ultraplot`.
# ultraplot also includes a :rcraw:`style` setting that can be used to
# UltraPlot also includes a :rcraw:`style` setting that can be used to
# switch between `matplotlib stylesheets
# <https://matplotlib.org/stable/gallery/style_sheets/style_sheets_reference.html>`__.
# See the :ref:`configuration section <ug_config>` for details.
Expand Down
14 changes: 7 additions & 7 deletions docs/cartesian.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@
# directly, they are available in the top-level namespace
# (e.g., ``xformatter=uplt.SciFormatter(...)`` is allowed).
#
# ultraplot also changes the default tick formatter to
# UltraPlot also changes the default tick formatter to
# `~ultraplot.ticker.AutoFormatter`. This class trims trailing zeros by
# default, can optionally omit or wrap tick values within particular
# number ranges, and can add prefixes and suffixes to each label. See
Expand Down Expand Up @@ -384,7 +384,7 @@
# coordinate system. To change the axis scale, pass e.g. ``xscale='log'`` or
# ``yscale='log'`` to `~ultraplot.axes.Axes.format`. This is powered by the
# `~ultraplot.constructor.Scale` :ref:`constructor function <why_constructor>`.
# ultraplot makes several changes to the axis scale API:
# UltraPlot makes several changes to the axis scale API:
#
# * The `~ultraplot.ticker.AutoFormatter` formatter is now used for all axis scales
# by default, including ``'log'`` and ``'symlog'``. Matplotlib's behavior can
Expand All @@ -398,14 +398,14 @@
# addition to "registered" names like ``'log'``.
# * While matplotlib axis scales must be instantiated with an
# `~matplotlib.axis.Axis` instance (for backwards compatibility reasons),
# ultraplot axis scales can be instantiated without the axis instance
# UltraPlot axis scales can be instantiated without the axis instance
# (e.g., ``uplt.LogScale()`` instead of ``uplt.LogScale(ax.xaxis)``).
# * The default `subs` for the ``'symlog'`` axis scale is now ``np.arange(1, 10)``,
# and the default `linthresh` is now ``1``. Also the ``'log'`` and ``'symlog'``
# axis scales now accept the keywords `base`, `linthresh`, `linscale`, and
# `subs` rather than keywords with trailing ``x`` or ``y``.
#
# ultraplot also includes a few new axis scales. The ``'cutoff'`` scale
# UltraPlot also includes a few new axis scales. The ``'cutoff'`` scale
# `~ultraplot.scale.CutoffScale` is useful when the statistical distribution
# of your data is very unusual. The ``'sine'`` scale `~ultraplot.scale.SineLatitudeScale`
# scales the axis with a sine function (resulting in an area-weighted spherical latitude
Expand Down Expand Up @@ -547,13 +547,13 @@
#
# The `matplotlib.axes.Axes` class includes `~matplotlib.axes.Axes.twinx`
# and `~matplotlib.axes.Axes.twiny` commands for drawing "twin" *x* and
# *y* axes in the same subplot. ultraplot expands on these commands and adds
# *y* axes in the same subplot. UltraPlot expands on these commands and adds
# the arguably more intuitive `~ultraplot.axes.CartesianAxes.altx` and
# `~ultraplot.axes.CartesianAxes.alty` options. Here `~ultraplot.axes.CartesianAxes.altx`
# is equivalent to `~ultraplot.axes.CartesianAxes.twiny` (makes an alternate *x*
# axes and an identical twin *y* axes) and `~ultraplot.axes.CartesianAxes.alty`
# is equivalent to `~ultraplot.axes.CartesianAxes.twinx` (makes an alternate *y*
# axes and an identical twin *x* axes). The ultraplot versions can be quickly
# axes and an identical twin *x* axes). The UltraPlot versions can be quickly
# formatted by passing `ultraplot.axes.CartesianAxes.format` keyword arguments
# to the commands (e.g., ``ax.alty(ycolor='red')`` or, since the ``y`` prefix in
# this context is redundant, just ``ax.alty(color='red')``). They also enforce
Expand All @@ -562,7 +562,7 @@
#
# .. note::
#
# Unlike matplotlib, ultraplot adds alternate axes as `children
# Unlike matplotlib, UltraPlot adds alternate axes as `children
# <https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.add_child_axes.html>`__
# of the original axes. This helps simplify the :ref:`tight layout algorithm
# <ug_tight>` but means that the drawing order is controlled by the difference
Expand Down
16 changes: 8 additions & 8 deletions docs/colorbars_legends.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
# Colorbars and legends
# =====================
#
# ultraplot includes some useful changes to the matplotlib API that make
# UltraPlot includes some useful changes to the matplotlib API that make
# working with colorbars and legends :ref:`easier <why_colorbars_legends>`.
# Notable features include "inset" colorbars, "outer" legends,
# on-the-fly colorbars and legends, colorbars built from artists,
Expand All @@ -36,7 +36,7 @@
# posssible using the somewhat opaque `bbox_to_anchor` keyword (see `here
# <https://matplotlib.org/stable/tutorials/intermediate/legend_guide.html#legend-location>`__)
# and "inset" colorbars are not possible without manually creating and positioning
# the associated axes. ultraplot tries to improve this behavior:
# the associated axes. UltraPlot tries to improve this behavior:
#
# * `ultraplot.axes.Axes.legend` can draw both "inset" legends when you request an inset
# location (e.g., ``loc='upper right'`` or the shorthand ``loc='ur'``) and "outer"
Expand All @@ -45,7 +45,7 @@
# or colorbars on one side, they are "stacked" on top of each other. Unlike using
# `bbox_to_anchor`, the "outer" legend position is adjusted automatically when the
# :ref:`tight layout algorithm <ug_tight>` is active.
# * ultraplot adds the axes command `ultraplot.axes.Axes.colorbar`,
# * UltraPlot adds the axes command `ultraplot.axes.Axes.colorbar`,
# analogous to `ultraplot.axes.Axes.legend` and equivalent to
# calling `ultraplot.figure.Figure.colorbar` with an `ax` keyword.
# `~ultraplot.axes.Axes.colorbar` can draw both "outer" colorbars when you request
Expand All @@ -65,14 +65,14 @@
#
# .. important::
#
# Unlike matplotlib, ultraplot adds "outer" colorbars and legends by allocating
# Unlike matplotlib, UltraPlot adds "outer" colorbars and legends by allocating
# new rows and columns in the `~ultraplot.gridspec.GridSpec` rather than
# "stealing" space from the parent subplot (note that subsequently indexing
# the `~ultraplot.gridspec.GridSpec` will ignore the slots allocated for
# colorbars and legends). This approach means that "outer" colorbars and
# legends :ref:`do not affect subplot aspect ratios <ug_autosize>`
# and :ref:`do not affect subplot spacing <ug_tight>`, which lets
# ultraplot avoid relying on complicated `"constrained layout" algorithms
# UltraPlot avoid relying on complicated `"constrained layout" algorithms
# <https://matplotlib.org/stable/tutorials/intermediate/constrainedlayout_guide.html>`__
# and tends to improve the appearance of figures with even the most
# complex arrangements of subplots, colorbars, and legends.
Expand Down Expand Up @@ -302,12 +302,12 @@
# keyword with :ref:`1D commands <ug_1dplots>` like `~ultraplot.axes.PlotAxes.plot`.
# * The associated :ref:`colormap normalizer <ug_norm>` can be specified with the
# `vmin`, `vmax`, `norm`, and `norm_kw` keywords. The `~ultraplot.colors.DiscreteNorm`
# levels can be specified with `values`, or ultraplot will infer them from the
# levels can be specified with `values`, or UltraPlot will infer them from the
# `~matplotlib.artist.Artist` labels (non-numeric labels will be applied to
# the colorbar as tick labels). This can be useful for labeling discrete plot
# elements that bear some numeric relationship to each other.
#
# ultraplot also includes improvements for adding ticks and tick labels to colorbars.
# UltraPlot also includes improvements for adding ticks and tick labels to colorbars.
# Similar to `ultraplot.axes.CartesianAxes.format`, you can flexibly specify
# major tick locations, minor tick locations, and major tick labels using the
# `locator`, `minorlocator`, `formatter`, `ticks`, `minorticks`, and `ticklabels`
Expand All @@ -317,7 +317,7 @@
# are restricted based on the axis length using `~ultraplot.ticker.DiscreteLocator`.
# You can easily toggle minor ticks using ``tickminor=True``.
#
# Similar to :ref:`axes panels <ug_panels>`, the geometry of ultraplot colorbars is
# Similar to :ref:`axes panels <ug_panels>`, the geometry of UltraPlot colorbars is
# specified with :ref:`physical units <ug_units>` (this helps avoid the common issue
# where colorbars appear "too skinny" or "too fat" and preserves their appearance
# when the figure size changes). You can specify the colorbar width locally using the
Expand Down
Loading
Loading