You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/overview.rst
+5-9Lines changed: 5 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,8 +4,6 @@ Quick overview
4
4
5
5
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.
6
6
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
-
9
7
This page is meant as the starting point for new users. It is
10
8
populated with links to the :ref:`API reference` and User Guide.
11
9
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
37
35
algorithm applied to all `~proplot.subplots.Figure`\ s by default.
38
36
See :ref:`Creating figures` for details.
39
37
40
-
Figure and axes commands
41
-
========================
38
+
Figure and axes methods
39
+
=======================
42
40
The new `~proplot.subplots.Figure` and `~proplot.axes.Axes` classes
43
41
override various matplotlib methods to implement tons of useful features.
44
42
45
43
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.
46
44
See :ref:`Customizing figures` for details.
47
45
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.
52
47
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.
Copy file name to clipboardExpand all lines: docs/why.rst
+6-10Lines changed: 6 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -137,11 +137,10 @@ Simpler colorbars and legends
137
137
138
138
<h3>Problem</h3>
139
139
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.
141
142
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.
145
144
146
145
..
147
146
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!
153
152
ProPlot introduces a brand new engine for drawing colorbars and legends along the outside of
154
153
individual subplots and along contiguous subplots on the edge of the figure:
155
154
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.
0 commit comments