Skip to content

Commit 6736ea6

Browse files
committed
Overview and why-proplot, split nb_setup() into 3 funcs
1 parent 2c1e3e1 commit 6736ea6

File tree

5 files changed

+249
-155
lines changed

5 files changed

+249
-155
lines changed

docs/faq.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Why do my inline figures look different?
3333

3434
These days, most publications prefer plots saved as `vector graphics <https://en.wikipedia.org/wiki/Vector_graphics>`__ [1]_ rather than `raster graphics <https://en.wikipedia.org/wiki/Raster_graphics>`__ [2]_. When you save vector graphics, the content sizes should be appropriate for embedding the plot in a document (for example, if an academic journal recommends 8-point font for plots, you should use 8-point font in your plotting code).
3535

36-
Matplotlib tends to generate really low-resolution, artifact-plagued jpegs -- and to keep them legible, they use a fairly large default figure width of 6.5 inches (usually only suitable for multi-panel plots) and a fairly large default font size of 10 points (where most journals recommend 5-9 points). This means your figures have to be downscaled, so the sizes used in your plotting code are not the sizes that appear in the document.
36+
Most of the default matplotlib backends make low-quality, artifact-plagued jpegs. To keep them legible, matplotlib uses a fairly large default figure width of 6.5 inches (usually only suitable for multi-panel plots) and a slightly large default font size of 10 points (where most journals recommend 5-9 points). This means your figures have to be downscaled so the sizes used in your plotting code are *not* the sizes that appear in the document.
3737

3838
ProPlot helps you get your figure sizes *correct* for embedding
3939
them as vector graphics inside publications.

docs/overview.rst

Lines changed: 30 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
11
==============
2-
Quick overview
2+
Usage overview
33
==============
44

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.
5+
ProPlot is an *object-oriented* matplotlib wrapper, which means
6+
most of its features derive from subclasses of the `~matplotlib.figure.Figure` and `~matplotlib.axes.Axes` classes. If you tend to use the `~matplotlib.pyplot` API and are not familiar with figure and axes "objects", you should first take a look at `this page <https://matplotlib.org/api/api_overview.html#the-pyplot-api>`__. Using the objects directly tends to be more clear and concise than `~matplotlib.pyplot` API, and makes life easier when working with multiple figures or axes.
67

7-
This page is meant as the starting point for new users. It is
8-
populated with links to the :ref:`API reference` and User Guide.
9-
For more in-depth descriptions, see :ref:`Why ProPlot?`.
8+
..
9+
This page gives a condensed overview of these features, along with features
10+
outside of these classes.
11+
..
12+
This page is meant as the starting point for new users. It is
13+
populated with links to the :ref:`API reference` and User Guide.
14+
For more in-depth descriptions, see :ref:`Why ProPlot?`.
1015
1116
Importing proplot
1217
=================
@@ -17,36 +22,28 @@ We recommend importing ProPlot with
1722
1823
import proplot as plot
1924
20-
This differentiates ProPlot from the usual ``plt`` abbreviation used for the `~matplotlib.pyplot` module.
25+
This differentiates ProPlot from the usual ``plt`` abbreviation used for the `~matplotlib.pyplot` module. Importing proplot immediately adds a bunch of new colormaps, property cyclers, color names, and fonts to matplotlib. See :ref:`Colormaps`, :ref:`Color cycles`, and :ref:`Colors and fonts` for details.
2126

22-
Importing proplot immediately adds a bunch of new colormaps, property cyclers, color names, and fonts to matplotlib and changes some default settings.
23-
If this is all you want and you don't care about the plotting features, simply
24-
``import proplot`` at the top of your script. See :ref:`Colormaps`, :ref:`Color cycles`, and :ref:`Colors and fonts` for details.
25-
26-
Top-level commands
27-
==================
28-
29-
ProPlot's features derive from the `~proplot.subplots.subplots` command, inspired
30-
by the pyplot `~matplotlib.pyplot.subplots` command.
31-
32-
The `~proplot.subplots.subplots` command creates a `~proplot.subplots.Figure` subclass
33-
populated with special `~proplot.axes.Axes` subclasses,
34-
and is packed with new features -- one highlight is the new :ref:`Figure tight layout`
35-
algorithm applied to all `~proplot.subplots.Figure`\ s by default.
36-
See :ref:`Creating figures` for details.
37-
38-
Figure and axes methods
27+
Figure and axes classes
3928
=======================
40-
The new `~proplot.subplots.Figure` and `~proplot.axes.Axes` classes
41-
override various matplotlib methods to implement tons of useful features.
29+
ProPlot's features derive from `~proplot.subplots.subplots`, modeled after
30+
the native `matplotlib.pyplot.subplots` command.
31+
`~proplot.subplots.subplots` creates a `~proplot.subplots.Figure` subclass
32+
populated with special `~proplot.axes.Axes` subclasses.
33+
See :ref:`Creating figures`
34+
and :ref:`Figure tight layout` for details.
4235

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.
44-
See :ref:`Customizing figures` for details.
36+
Each `~proplot.axes.Axes` class also belongs to
37+
one of the `~proplot.axes.XYAxes`, `~proplot.axes.PolarAxes`,
38+
or `~proplot.axes.ProjAxes` parent classes, depending on the projection used. See
39+
:ref:`Geographic and polar plots` for details.
4540

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.
41+
The `~proplot.subplots.Figure` and `~proplot.axes.Axes` subclasses
42+
include useful new methods and override several existing methods:
4743

48-
ProPlot also wraps several plotting methods on the `~proplot.axes.Axes` class.
49-
See :ref:`1d plotting` and :ref:`2d plotting` for details.
44+
* The most important new method is `~proplot.axes.Axes.format`, whose behavior depends on whether the axes is an `~proplot.axes.XYAxes`, `~proplot.axes.PolarAxes`, or `~proplot.axes.ProjAxes`. This method fine-tunes various axes settings. See :ref:`Customizing figures` for details.
45+
* The `~proplot.subplots.Figure` `~proplot.subplots.Figure.colorbar` and `~proplot.subplots.Figure.legend` and `~proplot.axes.Axes` `~proplot.axes.Axes.colorbar` and `~proplot.axes.Axes.legend` commands are used to add colorbars and legends *inside* of subplots, along the *outside edge* of subplots, and along the *edge of the figure*. See :ref:`Colorbars and legends` for details.
46+
* There is a huge variety of new features for working with contour plots, pcolor plots, heatmaps, line plots, error bars, bar plots, area plots, and parametric plots. See :ref:`1d plotting` and :ref:`2d plotting` for details.
5047

5148
Integration with other packages
5249
===============================
@@ -55,9 +52,9 @@ ProPlot includes integration with `xarray`, `pandas`, `cartopy`, and `~mpl_toolk
5552
* Axis labels, tick labels, titles, colorbar labels, and legend labels are automatically applied when you pass an `xarray.DataArray`, `pandas.DataFrame`, or `pandas.Series` object to any plotting command. This works just like the native `xarray.DataArray.plot` and `pandas.DataFrame.plot` methods. See :ref:`1d plotting` and :ref:`2d plotting` for details.
5653
* The `~proplot.projs.Proj` function lets you make arbitrary grids of basemap `~mpl_toolkits.basemap.Basemap` and cartopy `~cartopy.crs.Projection` projections. It is used to interpret the `proj` keyword arg passed to `~proplot.subplots.subplots`. The resulting axes are instances of `~proplot.axes.ProjAxes` with `~proplot.axes.ProjAxes.format` methods that can be used to add geographic features and custom meridian and parallel gridlines. See :ref:`Geographic and polar plots` for details.
5754

58-
Additional tools
59-
================
60-
ProPlot includes a bunch of additional tools outside
55+
Other functions and classes
56+
===========================
57+
ProPlot includes a bunch of useful tools outside
6158
of the `~proplot.subplots.Figure` and `~proplot.axes.Axes` subclasses:
6259

6360
* The `~proplot.styletools.Colormap` and `~proplot.styletools.Cycle` constructor functions. These can slice, merge, and modify colormaps and color cycles. See :ref:`Colormaps`, :ref:`Color cycles`, and :ref:`Colors and fonts` for details.

0 commit comments

Comments
 (0)