|
22 | 22 | # %% [raw] raw_mimetype="text/restructuredtext"
|
23 | 23 | # .. _ug_intro:
|
24 | 24 | #
|
25 |
| -# Figures and subplots |
26 |
| -# -------------------- |
| 25 | +# Creating figures |
| 26 | +# ---------------- |
27 | 27 | #
|
28 | 28 | # ProPlot works by subclassing the matplotlib `~matplotlib.figure.Figure` and
|
29 | 29 | # `~matplotlib.axes.Axes` classes. You can generate grids of proplot
|
|
47 | 47 | # and modify the axes using `~proplot.axes.Axes.format` and
|
48 | 48 | # `~proplot.ui.SubplotsContainer`. See the :ref:`formatting guide <ug_format>`
|
49 | 49 | # and :ref:`subplots container <ug_container>` sections for details.
|
| 50 | +# |
50 | 51 | # Please note that by default, ProPlot sets :rcraw:`figure.facecolor` to gray,
|
51 | 52 | # :rcraw:`savefig.facecolor` to white, and :rcraw:`savefig.transparent` to ``True``.
|
52 | 53 | # That is, the default display background is gray, the default background for
|
53 | 54 | # saved figures is transparent, and the default background is white when you pass
|
54 |
| -# ``transparent=False`` to `~matplotlib.figure.Figure.savefig`. See the |
55 |
| -# :ref:`configuration section <ug_proplotrc>` for how to change this. |
| 55 | +# ``transparent=False`` to `~matplotlib.figure.Figure.savefig`. |
| 56 | +# ProPlot also sets the default :rcraw:`savefig.format` to PDF, because |
| 57 | +# (1) vector graphic formats are always more suitable for matplotlib figures than |
| 58 | +# raster formats, (2) most academic journals these days accept PDF format figures |
| 59 | +# alongside the older EPS format, (3) PDF figures are easy to embed in LaTeX documents, |
| 60 | +# and (4) the EPS format does not support transparent graphic elements. If you *do* |
| 61 | +# need raster graphics, ProPlot sets the default :rcraw:`savefig.dpi` to 1200 dots per |
| 62 | +# inch, which is recommended by most journals as the minimum resolution for rasterized |
| 63 | +# figures containing lines and text. See the :ref:`configuration section <ug_proplotrc>` |
| 64 | +# for how to change these settings. |
56 | 65 |
|
57 | 66 | # %%
|
58 | 67 | import proplot as plot
|
|
218 | 227 | # ProPlot. `~proplot.config.rc` is similar to the matplotlib
|
219 | 228 | # `~matplotlib.rcParams` dictionary, but can be used to change (1)
|
220 | 229 | # matplotlib's `builtin settings
|
221 |
| -# <https://matplotlib.org/tutorials/introductory/customizing.html>`_, (2) |
222 |
| -# ProPlot's :ref:`added settings <rc_added>`, and (3) :ref:`quick settings |
223 |
| -# <rc_quick>` that can be used to change lots of matplotlib and ProPlot |
224 |
| -# settings at once. `~proplot.config.rc` also provides a ``style`` parameter |
225 |
| -# that can be used to switch between `matplotlib stylesheets\ |
| 230 | +# <https://matplotlib.org/tutorials/introductory/customizing.html>`_ and |
| 231 | +# (2) ProPlot's :ref:`added settings <rc_proplot>`. `~proplot.config.rc` also |
| 232 | +# provides a ``style`` parameter that can be used to switch between |
| 233 | +# `matplotlib stylesheets\ |
226 | 234 | # <https://matplotlib.org/3.1.1/gallery/style_sheets/style_sheets_reference.html>`__.
|
227 | 235 | # See the :ref:`configuration section <ug_config>` for details.
|
228 | 236 | #
|
|
245 | 253 | plot.rc.update({'fontname': 'Noto Sans'})
|
246 | 254 | plot.rc['figure.facecolor'] = 'gray3'
|
247 | 255 | plot.rc.axesfacecolor = 'gray4'
|
| 256 | +# plot.rc.save() # save the current settings to ~/.proplotrc |
248 | 257 |
|
249 | 258 | # Apply settings to figure with context()
|
250 | 259 | with plot.rc.context({'suptitle.size': 11}, toplabelcolor='gray6', linewidth=1.5):
|
|
0 commit comments