Skip to content

Commit 0fef320

Browse files
committed
Clean up docs
1 parent aeb0522 commit 0fef320

File tree

10 files changed

+248
-218
lines changed

10 files changed

+248
-218
lines changed

WHATSNEW.rst

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ This will be published when some major refactoring tasks are completed,
2727
and deprecation warnings will be removed. See :pr:`89`, :pr:`109`, :pr:`110`,
2828
and :pr:`111`.
2929

30-
ProPlot v0.8.0 (2021-##-##)
30+
ProPlot v0.9.0 (2021-##-##)
3131
===========================
3232

3333
.. rubric:: Deprecated
@@ -71,19 +71,21 @@ ProPlot v0.8.0 (2021-##-##)
7171
`~proplot.subplots.EdgeStack` stacks rather than getting inserted directly
7272
into the main `~proplot.subplots.GridSpec` (:pr:`110`).
7373

74-
ProPlot v0.7.1 (2021-##-##)
74+
ProPlot v0.8.0 (2021-##-##)
7575
===========================
7676

7777
.. rubric:: Bug fixes
7878

7979
* Fix issue where deprecated `aspect` `~proplot.ui.subplots` argument
8080
is ignored (:commit:`70a8b87d`).
8181
* Fix issue where `~proplot.axes.Axes.parametric` ignores `interp` when
82-
selecting default colormap levels (:commit:`152a3a81`).
83-
* Fix issue where a-b-c labels are removed in presence of ``'top'`` panels
84-
with ``titleabove=True`` (:commit:`7873d5e0`).
82+
selecting `DiscreteNorm` colormap levels (:commit:`152a3a81`).
8583
* Ensure `plot` returns tuples of handles instead of lists, and ensure `indicate_error`
8684
returns a singleton tuple containing ``(line, error)`` objects (:issue:`260`).
85+
* Fix issue where a-b-c labels are removed in presence of ``'top'`` panels
86+
with ``titleabove=True`` (:commit:`7873d5e0`).
87+
* Fix issue where thin pyplot-function wrappers e.g. ``isinteractive``
88+
do not return results (:commit:`e62e3655`).
8789

8890
.. rubric:: Features
8991

@@ -94,6 +96,20 @@ ProPlot v0.7.1 (2021-##-##)
9496
default row label rotation match default y label rotation (:commit:`bae85113`).
9597
* Make `~proplot.axes.colorbar_extras` capture matplotlib-native `format` keyword
9698
as alias for `formatter` and `ticklabels` (:issue:`262`).
99+
* Permit legends from mappables using ``ContourSet.legend_elements``
100+
and ``Collection.legend_elements`` (:pr:`264`).
101+
* Add `stepx` command analogous to `plotx` and `histh`, `boxploth`, and `violinploth`
102+
commands analogous to `barh` (:pr:`264`). Also add aliases.
103+
104+
.. rubric:: Internals
105+
106+
* Convert all plotting wrappers to dedicated overrides of individual functions
107+
(:pr:`264`). This massively simplifies the internals and makes learning
108+
and adopting proplot much easier for new users.
109+
* Use metaclasses to redirect internal plotting calls to native matplotlib
110+
methods (:pr:`264`). Much safer/more stable this way.
111+
* Use metaclasses to efficiently impose defaults ``latlon=True`` and
112+
``transform=PlateCarree()`` in 90% fewer lines (:pr:`264`).
97113

98114

99115
ProPlot v0.7.0 (2021-07-11)

docs/api.rst

Lines changed: 37 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,6 @@ Comprehensive documentation of ProPlot functions and classes. All of these
66
objects are imported into the top-level namespace, so you can read the
77
documentation within python sessions using ``help(pplt.<function_or_class>)``.
88

9-
Top-level functions
10-
===================
11-
12-
.. automodule:: proplot.ui
13-
14-
.. automodsumm:: proplot.ui
15-
:toctree: api
16-
17-
189
Figure class
1910
============
2011

@@ -34,22 +25,22 @@ Axes classes
3425
:classes-only:
3526

3627

37-
Constructor functions
38-
=====================
28+
Top-level functions
29+
===================
3930

40-
.. automodule:: proplot.constructor
31+
.. automodule:: proplot.ui
4132

42-
.. automodsumm:: proplot.constructor
33+
.. automodsumm:: proplot.ui
4334
:toctree: api
4435

45-
Configuration tools
46-
===================
4736

48-
.. automodule:: proplot.config
37+
Constructor functions
38+
=====================
4939

50-
.. automodsumm:: proplot.config
40+
.. automodule:: proplot.constructor
41+
42+
.. automodsumm:: proplot.constructor
5143
:toctree: api
52-
:skip: inline_backend_fmt
5344

5445

5546
Plotting wrappers
@@ -62,6 +53,16 @@ Plotting wrappers
6253
:functions-only:
6354

6455

56+
Configuration tools
57+
===================
58+
59+
.. automodule:: proplot.config
60+
61+
.. automodsumm:: proplot.config
62+
:toctree: api
63+
:skip: inline_backend_fmt
64+
65+
6566
Demo functions
6667
==============
6768

@@ -71,48 +72,48 @@ Demo functions
7172
:toctree: api
7273

7374

74-
Colormaps and normalizers
75-
=========================
75+
Gridspec classes
76+
================
7677

77-
.. automodule:: proplot.colors
78+
.. automodule:: proplot.gridspec
7879

79-
.. automodsumm:: proplot.colors
80+
.. automodsumm:: proplot.gridspec
8081
:toctree: api
8182

8283

83-
Locators and formatters
84-
=======================
84+
Projection classes
85+
==================
8586

86-
.. automodule:: proplot.ticker
87+
.. automodule:: proplot.crs
8788

88-
.. automodsumm:: proplot.ticker
89+
.. automodsumm:: proplot.crs
8990
:toctree: api
9091

9192

92-
Axis scale classes
93-
==================
93+
Axis scales
94+
===========
9495

9596
.. automodule:: proplot.scale
9697

9798
.. automodsumm:: proplot.scale
9899
:toctree: api
99100

100101

101-
Cartopy projections
102-
===================
102+
Locators and formatters
103+
=======================
103104

104-
.. automodule:: proplot.crs
105+
.. automodule:: proplot.ticker
105106

106-
.. automodsumm:: proplot.crs
107+
.. automodsumm:: proplot.ticker
107108
:toctree: api
108109

109110

110-
Gridspec classes
111-
================
111+
Colormaps and normalizers
112+
=========================
112113

113-
.. automodule:: proplot.gridspec
114+
.. automodule:: proplot.colors
114115

115-
.. automodsumm:: proplot.gridspec
116+
.. automodsumm:: proplot.colors
116117
:toctree: api
117118

118119

docs/axis.py

Lines changed: 62 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,12 @@
3030
# Tick locations
3131
# --------------
3232
#
33-
# `Tick locators
33+
# Matplotlib `tick locators
3434
# <https://matplotlib.org/stable/gallery/ticks_and_spines/tick-locators.html>`__
35-
# are used to automatically select sensible tick locations
36-
# based on the axis data limits. In ProPlot, you can change the tick locator
37-
# using the `~proplot.axes.Axes.format` keyword arguments `xlocator`,
38-
# `ylocator`, `xminorlocator`, and `yminorlocator` (or their aliases,
39-
# `xticks`, `yticks`, `xminorticks`, and `yminorticks`). This is powered by
35+
# select sensible tick locations based on the axis data limits. In ProPlot, you can
36+
# change the tick locator using the `~proplot.axes.CartesianAxes.format` keyword
37+
# arguments `xlocator`, `ylocator`, `xminorlocator`, and `yminorlocator` (or their
38+
# aliases, `xticks`, `yticks`, `xminorticks`, and `yminorticks`). This is powered by
4039
# the `~proplot.constructor.Locator` :ref:`constructor function <why_constructor>`.
4140
#
4241
# These keyword arguments can be used to apply built-in matplotlib
@@ -122,16 +121,15 @@
122121
# %% [raw] raw_mimetype="text/restructuredtext"
123122
# .. _ug_formatters:
124123
#
125-
# Tick labels
126-
# -----------
124+
# Tick formatting
125+
# ---------------
127126
#
128-
# `Tick formatters
127+
# Matplotlib `tick formatters
129128
# <https://matplotlib.org/stable/gallery/ticks_and_spines/tick-formatters.html>`__
130-
# are used to convert floating point numbers to
131-
# nicely-formatted tick labels. In ProPlot, you can change the tick formatter
132-
# using the `~proplot.axes.Axes.format` keyword arguments `xformatter` and
133-
# `yformatter` (or their aliases, `xticklabels` and `yticklabels`). This is
134-
# powered by the `~proplot.constructor.Formatter`
129+
# convert floating point numbers to nicely-formatted tick labels. In ProPlot, you can
130+
# change the tick formatter using the `~proplot.axes.CartesianAxes.format` keyword
131+
# arguments `xformatter` and `yformatter` (or their aliases, `xticklabels` and
132+
# `yticklabels`). This is powered by the `~proplot.constructor.Formatter`
135133
# :ref:`constructor function <why_constructor>`.
136134
#
137135
# These keyword arguments can be used to apply built-in matplotlib
@@ -155,6 +153,38 @@
155153
# `~proplot.ticker.AutoFormatter` for details. To disable the trailing
156154
# zero-trimming feature, set :rcraw:`formatter.zerotrim` to ``False``.
157155

156+
# %%
157+
import proplot as pplt
158+
pplt.rc.linewidth = 2
159+
pplt.rc.fontsize = 11
160+
locator = [0, 0.25, 0.5, 0.75, 1]
161+
fig, axs = pplt.subplots(ncols=2, nrows=2, refwidth=1.5, share=0)
162+
163+
# Formatter comparison
164+
axs[0].format(
165+
xformatter='scalar', yformatter='scalar', title='Matplotlib formatter'
166+
)
167+
axs[1].format(yticklabelloc='both', title='ProPlot formatter')
168+
axs[:2].format(xlocator=locator, ylocator=locator)
169+
170+
# Limiting the tick range
171+
axs[2].format(
172+
title='Omitting tick labels', ticklen=5, xlim=(0, 5), ylim=(0, 5),
173+
xtickrange=(0, 2), ytickrange=(0, 2), xlocator=1, ylocator=1
174+
)
175+
176+
# Setting the wrap range
177+
axs[3].format(
178+
title='Wrapping the tick range', ticklen=5, xlim=(0, 7), ylim=(0, 6),
179+
xwraprange=(0, 5), ywraprange=(0, 3), xlocator=1, ylocator=1
180+
)
181+
axs.format(
182+
ytickloc='both', yticklabelloc='both',
183+
titlepad='0.5em', suptitle='Default formatters demo'
184+
)
185+
pplt.rc.reset()
186+
187+
158188
# %%
159189
import proplot as pplt
160190
import numpy as np
@@ -207,54 +237,22 @@
207237
axs.format(ylocator='null', suptitle='Tick formatters demo')
208238
pplt.rc.reset()
209239

210-
# %%
211-
import proplot as pplt
212-
pplt.rc.linewidth = 2
213-
pplt.rc.fontsize = 11
214-
locator = [0, 0.25, 0.5, 0.75, 1]
215-
fig, axs = pplt.subplots(ncols=2, nrows=2, refwidth=1.5, share=0)
216-
217-
# Formatter comparison
218-
axs[0].format(
219-
xformatter='scalar', yformatter='scalar', title='Matplotlib formatter'
220-
)
221-
axs[1].format(yticklabelloc='both', title='ProPlot formatter')
222-
axs[:2].format(xlocator=locator, ylocator=locator)
223-
224-
# Limiting the tick range
225-
axs[2].format(
226-
title='Omitting tick labels', ticklen=5, xlim=(0, 5), ylim=(0, 5),
227-
xtickrange=(0, 2), ytickrange=(0, 2), xlocator=1, ylocator=1
228-
)
229-
230-
# Setting the wrap range
231-
axs[3].format(
232-
title='Wrapping the tick range', ticklen=5, xlim=(0, 7), ylim=(0, 6),
233-
xwraprange=(0, 5), ywraprange=(0, 3), xlocator=1, ylocator=1
234-
)
235-
axs.format(
236-
ytickloc='both', yticklabelloc='both',
237-
titlepad='0.5em', suptitle='Default formatters demo'
238-
)
239-
pplt.rc.reset()
240-
241-
242240
# %% [raw] raw_mimetype="text/restructuredtext"
243241
# .. _ug_datetime:
244242
#
245243
# Datetime ticks
246244
# --------------
247245
#
248246
# ProPlot can also be used to customize the tick locations and tick label
249-
# format of "datetime" axes. To draw ticks on some particular time unit, just
250-
# use a unit string (e.g., ``xlocator='month'``). To draw ticks every ``N``
251-
# time units, just use a (unit, N) tuple (e.g., ``xlocator=('day', 5)``). For
252-
# `% style formatting
247+
# format of "datetime" axes.
248+
# To draw ticks on some particular time unit, just use a unit string (e.g.,
249+
# ``xlocator='month'``). To draw ticks every ``N`` time units, just use a (unit, N)
250+
# tuple (e.g., ``xlocator=('day', 5)``). For `% style formatting
253251
# <https://docs.python.org/3/library/datetime.html#strftime-strptime-behavior>`__
254252
# of datetime tick labels, just use a string containing ``'%'`` (e.g.
255-
# ``xformatter='%Y-%m-%d'``). See `~proplot.axes.CartesianAxes.format`,
256-
# `~proplot.constructor.Locator`, and `~proplot.constructor.Formatter` for
257-
# details.
253+
# ``xformatter='%Y-%m-%d'``).
254+
# See `~proplot.axes.CartesianAxes.format`, `~proplot.constructor.Locator`,
255+
# and `~proplot.constructor.Formatter` for details.
258256

259257
# %%
260258
import proplot as pplt
@@ -308,8 +306,8 @@
308306
# %% [raw] raw_mimetype="text/restructuredtext"
309307
# .. _ug_scales:
310308
#
311-
# Changing the axis scale
312-
# -----------------------
309+
# Axis scale changes
310+
# ------------------
313311
#
314312
# "Axis scales" like ``'linear'`` and ``'log'`` control the *x* and *y* axis
315313
# coordinate system. To change the axis scale, simply pass e.g.
@@ -319,21 +317,20 @@
319317
#
320318
# ProPlot also makes several changes to the axis scale API:
321319
#
322-
# * By default, the `~proplot.ticker.AutoFormatter` formatter is used for all
323-
# axis scales instead of e.g. `~matplotlib.ticker.LogFormatter` for
324-
# `~matplotlib.scale.LogScale` scales. This can be changed e.g. by passing
325-
# ``xformatter='log'`` or ``yformatter='log'`` to
320+
# * The `~proplot.ticker.AutoFormatter` formatter is now used for all axis scales
321+
# by default, including ``'log'`` and ``'symlog'``. Matplotlib's behavior can
322+
# be restored by passing e.g. ``xformatter='log'`` or ``yformatter='log'`` to
326323
# `~proplot.axes.CartesianAxes.format`.
327324
# * To make its behavior consistent with `~proplot.constructor.Locator` and
328325
# `~proplot.constructor.Formatter`, the `~proplot.constructor.Scale`
329326
# constructor function returns instances of `~matplotlib.scale.ScaleBase`,
330327
# and `~matplotlib.axes.Axes.set_xscale` and
331328
# `~matplotlib.axes.Axes.set_yscale` now accept these class instances in
332-
# addition to string names like ``'log'``.
329+
# addition to "registered" names like ``'log'``.
333330
# * While matplotlib axis scales must be instantiated with an
334-
# `~matplotlib.axis.Axis` instance (for backward compatibility reasons),
335-
# ProPlot axis scales can be instantiated without the axis instance (e.g.
336-
# ``pplt.LogScale()`` instead of ``pplt.LogScale(ax.xaxis)``).
331+
# `~matplotlib.axis.Axis` instance (for backwards compatibility reasons),
332+
# ProPlot axis scales can be instantiated without the axis instance
333+
# (e.g., ``pplt.LogScale()`` instead of ``pplt.LogScale(ax.xaxis)``).
337334
# * The default `subs` for the ``'symlog'`` axis scale is now ``np.arange(1, 10)``,
338335
# and the default `linthresh` is now ``1``. Also the ``'log'`` and ``'symlog'``
339336
# axis scales now accept the keywords `base`, `linthresh`, `linscale`, and
@@ -474,8 +471,8 @@
474471
# %% [raw] raw_mimetype="text/restructuredtext"
475472
# .. _ug_dual:
476473
#
477-
# Dual unit axes
478-
# --------------
474+
# Dual unit scales
475+
# ----------------
479476
#
480477
# The `~proplot.axes.CartesianAxes.dualx` and
481478
# `~proplot.axes.CartesianAxes.dualy` methods can be used to draw duplicate

0 commit comments

Comments
 (0)