Skip to content

Commit 2c1e3e1

Browse files
committed
Why and overview
1 parent 62d94e0 commit 2c1e3e1

File tree

2 files changed

+11
-19
lines changed

2 files changed

+11
-19
lines changed

docs/overview.rst

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ Quick overview
44

55
ProPlot is an object-oriented matplotlib wrapper for making beautiful, publication-quality graphics. Most of its features derive from subclasses of the `~matplotlib.figure.Figure` and `~matplotlib.axes.Axes` classes.
66

7-
If you tend to use the `~matplotlib.pyplot` API and are not familiar with the "axes" and "figure" classes, you should first take a look at `this page <https://matplotlib.org/api/api_overview.html#the-pyplot-api>`__. Using axes and figure objects directly is *much* more clear and concise than using the `~matplotlib.pyplot` API. And changing settings for more than one axes at once gets really cumbersome with `~matplotlib.pyplot`.
8-
97
This page is meant as the starting point for new users. It is
108
populated with links to the :ref:`API reference` and User Guide.
119
For more in-depth descriptions, see :ref:`Why ProPlot?`.
@@ -37,20 +35,18 @@ and is packed with new features -- one highlight is the new :ref:`Figure tight l
3735
algorithm applied to all `~proplot.subplots.Figure`\ s by default.
3836
See :ref:`Creating figures` for details.
3937

40-
Figure and axes commands
41-
========================
38+
Figure and axes methods
39+
=======================
4240
The new `~proplot.subplots.Figure` and `~proplot.axes.Axes` classes
4341
override various matplotlib methods to implement tons of useful features.
4442

4543
The most important new method is `~proplot.axes.Axes.format`. This is available on every axes subclass generated by proplot -- `~proplot.axes.XYAxes`, `~proplot.axes.PolarAxes`, and `~proplot.axes.ProjAxes`. Use this method to fine-tune your axis properties, titles, labels, limits, arbitrary settings, and much much more.
4644
See :ref:`Customizing figures` for details.
4745

48-
Outer colorbars and legends
49-
===========================
50-
Proplot adds new `~proplot.axes.Axes` `~proplot.axes.Axes.colorbar` and `~proplot.axes.Axes.legend` commands and `~proplot.subplots.Figure` `~proplot.subplots.Figure.colorbar` and `~proplot.subplots.Figure.legend` commands that make adding colorbars and legends to the *outside* of axes simple.
51-
See :ref:`Colorbars and legends` for details.
46+
Proplot adds new `~proplot.axes.Axes` `~proplot.axes.Axes.colorbar` and `~proplot.axes.Axes.legend` commands and `~proplot.subplots.Figure` `~proplot.subplots.Figure.colorbar` and `~proplot.subplots.Figure.legend` commands that make adding colorbars and legends to the *outside* of axes simple. See :ref:`Colorbars and legends` for details.
5247

53-
The `~proplot.subplots.Figure` methods align objects with respect to the subplot grid, rather than the figure bounds. You can also make inset colorbars, make colorbars from lists of lines or colors, and make legends with centered rows instead of aligned columns.
48+
ProPlot also wraps several plotting methods on the `~proplot.axes.Axes` class.
49+
See :ref:`1d plotting` and :ref:`2d plotting` for details.
5450

5551
Integration with other packages
5652
===============================

docs/why.rst

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -137,11 +137,10 @@ Simpler colorbars and legends
137137

138138
<h3>Problem</h3>
139139

140-
In matplotlib, it is hard to put colorbars and legends on the outside of subplots. It can end up messing up subplot aspect ratios, and colorbars tend to be too narrow or too wide.
140+
In matplotlib, it is hard to draw `~matplotlib.figure.Figure.colorbar`\ s and
141+
`~matplotlib.axes.Axes.legend`\ s on the outside of subplots. It can end up messing up subplot aspect ratios, and colorbars tend to be too narrow or too wide.
141142

142-
It is *also* difficult to draw colorbars and legends that span the figure edge or serve as reference to more than one subplot.
143-
Because this requires so much tinkering, most users just add identical colorbars
144-
to every single subplot, which is incredibly repetitive!
143+
It is *also* difficult to draw `~matplotlib.figure.Figure.colorbar`\ s and `~matplotlib.figure.Figure.legend`\ s that span the figure edge or reference more than one subplot. "Figure colorbars" require drawing your own dedicated colorbar axes, which requires so much tinkering that most users just add identical colorbars to every single subplot! Meanwhile legends tend to look misaligned -- they are centered with respect to the figure edges rather than the subplot grid, which is a problem if your left-right or top-bottom border padding is asymmetric.
145144

146145
..
147146
Drawing colorbars and legends is pretty clumsy in matplotlib -- especially when trying to draw them outside of the figure. They can be too narrow, too wide, and mess up your subplot aspect ratios.
@@ -153,12 +152,9 @@ to every single subplot, which is incredibly repetitive!
153152
ProPlot introduces a brand new engine for drawing colorbars and legends along the outside of
154153
individual subplots and along contiguous subplots on the edge of the figure:
155154

156-
* The `~proplot.axes.Axes` `~proplot.axes.Axes.legend` command and the `~proplot.subplots.Figure` `~proplot.subplots.Figure.colorbar` and `~proplot.subplots.Figure.legend` commands are overridden, adding various new features.
157-
* There is a new `~proplot.axes.Axes` `~proplot.axes.Axes.colorbar` method for drawing *inset* colorbars or adding colorbars along the outer edge of axes.
158-
* The `~proplot.subplots.Figure` `~proplot.subplots.Figure.colorbar` and `~proplot.subplots.Figure.legend` commands draw colorbars and legends that are centered relative to the *subplot grid*, not the axes. This is critical if your left-right or top-bottom border padding is asymmetric.
159-
* You can put colorbars and legends along the edge of axes or along the edge of the whole figure by passing ``loc='l'``, ``loc='r'``, ``loc='b'``, or ``loc='t'`` to the colorbar and legend commands.
160-
* Outer colorbars and legends don't mess up the subplot layout or subplot aspect ratios, since the new `~proplot.subplots.FlexibleGridSpec` class permits variable spacing between subplot rows and columns. This is critical e.g. if you have a colorbar between columns 1 and 2 but nothing between columns 2 and 3.
161-
* The width of colorbars are now specified in physical units. This makes it easier to get the thickness just right, and makes thickness independent of figure size.
155+
* The `~proplot.axes.Axes` `~proplot.axes.Axes.legend` command and the `~proplot.subplots.Figure` `~proplot.subplots.Figure.colorbar` and `~proplot.subplots.Figure.legend` commands are overridden, adding various new features like colorbars-from-lines and centered-row legends. There is also a new `~proplot.axes.Axes` `~proplot.axes.Axes.colorbar` method for drawing *inset* colorbars or colorbars along the outer edge of axes.
156+
* Passing ``loc='l'``, ``loc='r'``, ``loc='b'``, or ``loc='t'`` to `~proplot.axes.Axes` `~proplot.axes.Axes.colorbar` or `~proplot.axes.Axes` `~proplot.axes.Axes.legend` draws the colorbar or legend along outside of the axes. Passing these to `~proplot.subplots.Figure` `~proplot.subplots.Figure.colorbar` and `~proplot.subplots.Figure.legend` draws the colorbar or legend along the edge of the figure, centered relative to the *subplot grid* rather than figure coordinates.
157+
* Outer colorbars and legends don't mess up the subplot layout or subplot aspect ratios, since the new `~proplot.subplots.FlexibleGridSpec` class permits variable spacing between subplot rows and columns. This is critical e.g. if you have a colorbar between columns 1 and 2 but nothing between columns 2 and 3. Colorbar widths are also specified in physical units, which makes the thickness independent of figure size and makes it easier to get the thickness just right.
162158

163159
The axes container class
164160
========================

0 commit comments

Comments
 (0)