Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
c4b5236
fixed styling ultraplot to UltraPlot
cvanelteren Feb 21, 2025
a00c50c
update docs to build with ultraplot rather than UltraPlot
cvanelteren Feb 21, 2025
0e24d1c
regex replace with sphinx indicators
cvanelteren Feb 21, 2025
e0cd42f
regex cycler replace
cvanelteren Feb 21, 2025
588a51c
manual interventions
cvanelteren Feb 21, 2025
8d57d9d
another edge case fixed
cvanelteren Feb 21, 2025
6f3946a
further replace with regex
cvanelteren Feb 21, 2025
7feb64a
further replace with regex
cvanelteren Feb 21, 2025
f4f1084
replace double class
cvanelteren Feb 21, 2025
f5d10fd
replace double func
cvanelteren Feb 21, 2025
008a12e
various manual fixes
cvanelteren Feb 21, 2025
054add3
more manual fixes
cvanelteren Feb 21, 2025
fd02de8
configure autodoc to hide private functions
cvanelteren Feb 21, 2025
972c507
further fixes
cvanelteren Feb 21, 2025
251acac
explicit hide private functions
cvanelteren Feb 21, 2025
41a531b
rm redundant code
cvanelteren Feb 21, 2025
b711344
corrected basemap url
cvanelteren Feb 21, 2025
05ee85f
looks good -- removed autoapi
cvanelteren Feb 21, 2025
6ebdcf0
minor fix
cvanelteren Feb 21, 2025
e2792ab
minor fix
cvanelteren Feb 21, 2025
7f705bb
replace double class
cvanelteren Feb 21, 2025
1713f74
Update docs/Makefile
cvanelteren Feb 21, 2025
d84af35
Update docs/external-links.rst
cvanelteren Feb 21, 2025
dd59cff
Update docs/cartesian.py
cvanelteren Feb 21, 2025
d2f4442
Update docs/why.rst
cvanelteren Feb 21, 2025
d17e923
Update docs/why.rst
cvanelteren Feb 21, 2025
1013234
Update docs/index.rst
cvanelteren Feb 21, 2025
a5054f8
Update docs/external-links.rst
cvanelteren Feb 21, 2025
93cf381
Update docs/authors.rst
cvanelteren Feb 21, 2025
2eb0992
Merge branch 'main' into doc-link-fix
cvanelteren Feb 21, 2025
68b2c97
Update docs/conf.py
cvanelteren Feb 21, 2025
f9ea9d6
pinning sphinx
cvanelteren Feb 21, 2025
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
110 changes: 55 additions & 55 deletions WHATSNEW.rst

Large diffs are not rendered by default.

126 changes: 63 additions & 63 deletions docs/1dplots.py

Large diffs are not rendered by default.

88 changes: 44 additions & 44 deletions docs/2dplots.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,22 +24,22 @@
# 2D plotting commands
# ====================
#
# ultraplot adds :ref:`several new features <why_plotting>` to matplotlib's
# plotting commands using the intermediate `~ultraplot.axes.PlotAxes` class.
# UltraPlot adds :ref:`several new features <why_plotting>` to matplotlib's
# plotting commands using the intermediate :class:`~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
# in matplotlib. This section documents the features added for 2D plotting commands
# like `~ultraplot.axes.PlotAxes.contour`, `~ultraplot.axes.PlotAxes.pcolor`,
# and `~ultraplot.axes.PlotAxes.imshow`.
# like :func:`~ultraplot.axes.PlotAxes.contour`, :func:`~ultraplot.axes.PlotAxes.pcolor`,
# and :func:`~ultraplot.axes.PlotAxes.imshow`.
#
# .. important::
#
# By default, ultraplot automatically adjusts the width of
# `~ultraplot.axes.PlotAxes.contourf` and `~ultraplot.axes.PlotAxes.pcolor` edges
# By default, UltraPlot automatically adjusts the width of
# :func:`~ultraplot.axes.PlotAxes.contourf` and :func:`~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
# slow down the drawing time for large datasets. To disable this feature,
# pass ``edgefix=False`` to the relevant `~ultraplot.axes.PlotAxes` command,
# pass ``edgefix=False`` to the relevant :class:`~ultraplot.axes.PlotAxes` command,
# or set :rcraw:`edgefix` to ``False`` to disable globally.

# %% [raw] raw_mimetype="text/restructuredtext"
Expand All @@ -48,29 +48,29 @@
# Data arguments
# --------------
#
# The treatment of data arguments passed to the 2D `~ultraplot.axes.PlotAxes`
# The treatment of data arguments passed to the 2D :class:`~ultraplot.axes.PlotAxes`
# commands is standardized. For each command, you can optionally omit the *x*
# and *y* coordinates, in which case they are inferred from the data
# (see :ref:`xarray and pandas integration <ug_2dintegration>`). If coordinates
# are string labels, they are converted to indices and tick labels using
# `~ultraplot.ticker.IndexLocator` and `~ultraplot.ticker.IndexFormatter`.
# :class:`~ultraplot.ticker.IndexLocator` and :class:`~ultraplot.ticker.IndexFormatter`.
# If coordinates are descending and the axis limits are unset, the axis
# direction is automatically reversed. If coordinate *centers* are passed to commands
# like `~ultraplot.axes.PlotAxes.pcolor` and `~ultraplot.axes.PlotAxes.pcolormesh`, they
# are automatically converted to edges using `~ultraplot.utils.edges` or
# `~ultraplot.utils.edges2d`, and if coordinate *edges* are passed to commands like
# `~ultraplot.axes.PlotAxes.contour` and `~ultraplot.axes.PlotAxes.contourf`, they are
# like :func:`~ultraplot.axes.PlotAxes.pcolor` and :func:`~ultraplot.axes.PlotAxes.pcolormesh`, they
# are automatically converted to edges using :func:`~ultraplot.utils.edges` or
# `:func:`~ultraplot.utils.edges2d``, and if coordinate *edges* are passed to commands like
# :func:`~ultraplot.axes.PlotAxes.contour` and :func:`~ultraplot.axes.PlotAxes.contourf`, they are
# automatically converted to centers (notice the locations of the rectangle edges
# in the ``pcolor`` plots below). All positional arguments can also be specified
# as keyword arguments (see the documentation for each plotting command).
#
# .. note::
#
# By default, when choosing the colormap :ref:`normalization
# 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
# range <ug_apply_cmap>`, UltraPlot ignores data outside the *x* or *y* axis
# limits if they were previously fixed by :func:`~matplotlib.axes.Axes.set_xlim` or
# :func:`~matplotlib.axes.Axes.set_ylim` (or, equivalently, by passing `xlim` or
# `ylim` to :func:`ultraplot.axes.CartesianAxes.format`). This can be useful if you
# wish to restrict the view along the *x* or *y* axis within a large dataset.
# To disable this feature, pass ``inbounds=False`` to the plotting command or
# set :rcraw:`cmap.inbounds` to ``False`` (see also the :rcraw:`axes.inbounds`
Expand Down Expand Up @@ -157,7 +157,7 @@
# Pandas and xarray integration
# -----------------------------
#
# The 2D `~ultraplot.axes.PlotAxes` commands recognize `pandas`_
# The 2D :class:`~ultraplot.axes.PlotAxes` commands recognize `pandas`_
# and `xarray`_ data structures. If you omit *x* and *y* coordinates,
# the commands try to infer them from the `pandas.DataFrame` or
# `xarray.DataArray`. If you did not explicitly set the *x* or *y* axis label
Expand All @@ -168,19 +168,19 @@
#
# These features restore some of the convenience you get with the builtin
# `pandas`_ and `xarray`_ plotting functions. They are also *optional* --
# installation of pandas and xarray are not required to use ultraplot. The
# installation of pandas and xarray are not required to use UltraPlot. The
# automatic labels can be disabled by setting :rcraw:`autoformat` to ``False``
# or by passing ``autoformat=False`` to any plotting command.
#
# .. note::
#
# For every plotting command, you can pass a `~xarray.Dataset`, `~pandas.DataFrame`,
# For every plotting command, you can pass a `~xarray.Dataset`, :class:`~pandas.DataFrame`,
# or `dict` to the `data` keyword with strings as data arguments instead of arrays
# -- just like matplotlib. For example, ``ax.plot('y', data=dataset)`` and
# ``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
# Also, if you pass a `pint.Quantity` or :class:`~xarray.DataArray`
# containing a `pint.Quantity`, UltraPlot will automatically call
# `~pint.UnitRegistry.setup_matplotlib` so that the axes become unit-aware.

# %%
Expand Down Expand Up @@ -244,15 +244,15 @@
# ---------------------
#
# It is often useful to create custom colormaps on-the-fly,
# without explicitly calling the `~ultraplot.constructor.Colormap`
# without explicitly calling the :class:`~ultraplot.constructor.Colormap`
# :ref:`constructor function <why_constructor>`. You can do so using the `cmap`
# and `cmap_kw` keywords, available with most `~ultraplot.axes.PlotAxes` 2D plot
# and `cmap_kw` keywords, available with most :class:`~ultraplot.axes.PlotAxes` 2D plot
# commands. For example, to create and apply a monochromatic colormap, you can use
# ``cmap='color_name'`` (see the :ref:`colormaps section <ug_cmaps_new>` for more info).
# You can also create on-the-fly "qualitative" `~ultraplot.colors.DiscreteColormap`\ s
# You can also create on-the-fly "qualitative" :class:`~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,9 +429,9 @@
# Discrete levels
# ---------------
#
# 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`).
# By default, UltraPlot uses `~ultraplot.colors.DiscreteNorm` to "discretize"
# the possible colormap colors for contour and pseudocolor :class:`~ultraplot.axes.PlotAxes`
# commands (e.g., :func:`~ultraplot.axes.PlotAxes.contourf`, :func:`~ultraplot.axes.PlotAxes.pcolor`).
# This is analogous to `matplotlib.colors.BoundaryNorm`, except
# `~ultraplot.colors.DiscreteNorm` can be paired with arbitrary
# continuous normalizers specified by `norm` (see :ref:`above <ug_norm>`).
Expand All @@ -448,7 +448,7 @@
# or pass ``discrete=False`` or ``discrete=True`` to any plotting command
# that accepts a `cmap` argument. The level edges or centers used with
# `~ultraplot.colors.DiscreteNorm` can be explicitly specified using the `levels` or
# `values` keywords, respectively (`~ultraplot.utils.arange` and `~ultraplot.utils.edges`
# `values` keywords, respectively (:func:`~ultraplot.utils.arange` and :func:`~ultraplot.utils.edges`
# are useful for generating `levels` and `values` lists). You can also pass an integer
# to these keywords (or to the `N` keyword) to automatically generate approximately this
# many level edges or centers at "nice" intervals. The algorithm used to generate levels
Expand All @@ -460,7 +460,7 @@
# <ug_locators>` for more on locators). You can also use the keywords `negative`,
# `positive`, or `symmetric` to ensure that your levels are strictly negative,
# positive, or symmetric about zero, or use the `nozero` keyword to remove
# the zero level (useful for single-color `~ultraplot.axes.PlotAxes.contour` plots).
# the zero level (useful for single-color :func:`~ultraplot.axes.PlotAxes.contour` plots).

# %%
import ultraplot as uplt
Expand Down Expand Up @@ -529,10 +529,10 @@
#
# 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`
# of the same name. Passing ``robust=True`` to a :class:`~ultraplot.axes.PlotAxes`
# 2D plot command will limit the default colormap normalization between
# the 2nd and 98th data percentiles. This range can be customized by passing
# an integer to `robust` (e.g. ``robust=90`` limits the normalization range
Expand All @@ -543,10 +543,10 @@
#
# Additionally, `similar to xarray
# <http://xarray.pydata.org/en/stable/user-guide/plotting.html#colormaps>`__,
# ultraplot can automatically detect "diverging" datasets. By default,
# the 2D `~ultraplot.axes.PlotAxes` commands will apply the diverging colormap
# UltraPlot can automatically detect "diverging" datasets. By default,
# the 2D :class:`~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`
# normalizer `~ultraplot.colors.DivergingNorm` (rather than :class:`~matplotlib.colors.Normalize`
# -- see :ref:`above <ug_norm>`) if the following conditions are met:
#
# #. If discrete levels are enabled (see :ref:`above <ug_discrete>`) and the
Expand Down Expand Up @@ -592,14 +592,14 @@
# Quick labels
# ------------
#
# You can now quickly add labels to `~ultraplot.axes.PlotAxes.contour`,
# `~ultraplot.axes.PlotAxes.contourf`, `~ultraplot.axes.PlotAxes.pcolor`,
# `~ultraplot.axes.PlotAxes.pcolormesh`, and `~ultraplot.axes.PlotAxes.heatmap`,
# You can now quickly add labels to :func:`~ultraplot.axes.PlotAxes.contour`,
# :func:`~ultraplot.axes.PlotAxes.contourf`, :func:`~ultraplot.axes.PlotAxes.pcolor`,
# :func:`~ultraplot.axes.PlotAxes.pcolormesh`, and :func:`~ultraplot.axes.PlotAxes.heatmap`,
# plots by passing ``labels=True`` to the plotting command. The
# label text is colored black or white depending on the luminance of the underlying
# grid box or filled contour (see the section on :ref:`colorspaces <ug_perceptual>`).
# Contour labels are drawn with `~matplotlib.axes.Axes.clabel` and grid box
# labels are drawn with `~ultraplot.axes.Axes.text`. You can pass keyword arguments
# labels are drawn with :func:`~ultraplot.axes.Axes.text`. You can pass keyword arguments
# to these functions by passing a dictionary to `labels_kw`, and you can
# change the label precision using the `precision` keyword. See the plotting
# command documentation for details.
Expand Down Expand Up @@ -653,13 +653,13 @@
# Heatmap plots
# -------------
#
# The `~ultraplot.axes.PlotAxes.heatmap` command can be used to draw "heatmaps" of
# The :func:`~ultraplot.axes.PlotAxes.heatmap` command can be used to draw "heatmaps" of
# 2-dimensional data. This is a convenience function equivalent to
# `~ultraplot.axes.PlotAxes.pcolormesh`, except the axes are configured with settings
# :func:`~ultraplot.axes.PlotAxes.pcolormesh`, except the axes are configured with settings
# suitable for heatmaps: fixed aspect ratios (ensuring "square" grid boxes), no
# gridlines, no minor ticks, and major ticks at the center of each box. Among other
# things, this is useful for displaying covariance and correlation matrices, as shown
# below. `~ultraplot.axes.PlotAxes.heatmap` should generally only be used with
# below. :func:`~ultraplot.axes.PlotAxes.heatmap` should generally only be used with
# `~ultraplot.axes.CartesianAxes`.

# %%
Expand Down
24 changes: 19 additions & 5 deletions docs/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,25 @@ The comprehensive API reference. All of the below objects are imported
into the top-level namespace. Use ``help(uplt.object)`` to read
the docs during a python session.

Please note that ultraplot removes the associated documentation when functionality
is deprecated (see :ref:`What's New <whats_new>`). However, ultraplot adheres to
Please note that UltraPlot removes the associated documentation when functionality
is deprecated (see :ref:`What's New <whats_new>`). However, UltraPlot adheres to
`semantic versioning <https://semver.org>`__, which means old code that uses
deprecated functionality will still work and issue warnings rather than errors
until the first major release (version 1.0.0).

.. important::

The documentation for "wrapper" functions like `standardize_1d` and `cmap_changer`
from ultraplot < 0.8.0 can now be found under individual `~ultraplot.axes.PlotAxes`
methods like `~ultraplot.axes.PlotAxes.plot` and `~ultraplot.axes.PlotAxes.pcolor`. Note
that calling ``help(ax.method)`` in a python session will show both the ultraplot
from UltraPlot < 0.8.0 can now be found under individual :class:`~ultraplot.axes.PlotAxes`
methods like :func:`~ultraplot.axes.PlotAxes.plot` and :func:`~ultraplot.axes.PlotAxes.pcolor`. Note
that calling ``help(ax.method)`` in a python session will show both the UltraPlot
documentation and the original matplotlib documentation.

Figure class
============

.. automodule:: ultraplot.figure
:no-private-members:

.. automodsumm:: ultraplot.figure
:toctree: api
Expand All @@ -35,6 +36,9 @@ Grid classes
============

.. automodule:: ultraplot.gridspec
:no-private-members:



.. automodsumm:: ultraplot.gridspec
:toctree: api
Expand All @@ -45,6 +49,7 @@ Axes classes
============

.. automodule:: ultraplot.axes
:no-private-members:

.. automodsumm:: ultraplot.axes
:toctree: api
Expand All @@ -54,6 +59,7 @@ Top-level functions
===================

.. automodule:: ultraplot.ui
:no-private-members:

.. automodsumm:: ultraplot.ui
:toctree: api
Expand All @@ -63,6 +69,7 @@ Configuration tools
===================

.. automodule:: ultraplot.config
:no-private-members:

.. automodsumm:: ultraplot.config
:toctree: api
Expand All @@ -73,6 +80,7 @@ Constructor functions
=====================

.. automodule:: ultraplot.constructor
:no-private-members:

.. automodsumm:: ultraplot.constructor
:toctree: api
Expand All @@ -83,6 +91,7 @@ Locators and formatters
=======================

.. automodule:: ultraplot.ticker
:no-private-members:

.. automodsumm:: ultraplot.ticker
:toctree: api
Expand All @@ -92,6 +101,7 @@ Axis scale classes
==================

.. automodule:: ultraplot.scale
:no-private-members:

.. automodsumm:: ultraplot.scale
:toctree: api
Expand All @@ -101,6 +111,7 @@ Colormaps and normalizers
=========================

.. automodule:: ultraplot.colors
:no-private-members:

.. automodsumm:: ultraplot.colors
:toctree: api
Expand All @@ -111,6 +122,7 @@ Projection classes
==================

.. automodule:: ultraplot.proj
:no-private-members:

.. automodsumm:: ultraplot.proj
:toctree: api
Expand All @@ -120,6 +132,7 @@ Demo functions
==============

.. automodule:: ultraplot.demos
:no-private-members:

.. automodsumm:: ultraplot.demos
:toctree: api
Expand All @@ -129,6 +142,7 @@ Miscellaneous functions
=======================

.. automodule:: ultraplot.utils
:no-private-members:

.. automodsumm:: ultraplot.utils
:toctree: api
Expand Down
4 changes: 2 additions & 2 deletions docs/authors.rst
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ as an avid vim user.

`Riley Brady`_ is the next-biggest contributor. He helped Luke set up automatic
testing, deploy this project to PyPi, and improve new user experience. He is
also ultraplot's earliest user and helped fix `lots of early bugs
<https://github.com/ultraplot-dev/ultraplot/issues?q=is%3Aissue+is%3Aclosed>`__.
also UltraPlot's earliest user and helped fix `lots of early bugs
<https://github.com/Ultraplot-dev/ultraplot/issues?q=is%3Aissue+is%3Aclosed>`__.

.. _Luke Davis: https://github.com/lukelbd

Expand Down
Loading
Loading