|
5 | 5 | # extension: .py |
6 | 6 | # format_name: percent |
7 | 7 | # format_version: '1.3' |
8 | | -# jupytext_version: 1.3.0 |
| 8 | +# jupytext_version: 1.4.2 |
9 | 9 | # kernelspec: |
10 | 10 | # display_name: Python 3 |
11 | 11 | # language: python |
|
44 | 44 | # subplot and ``0`` indicates an empty space. |
45 | 45 | # |
46 | 46 | # In the below examples, we create a few simple figures with `~proplot.ui.subplots`. |
47 | | -# See the next sections for details. |
| 47 | +# See the :ref:`next sections <ug_format>` for details. |
48 | 48 |
|
49 | 49 | # %% [raw] raw_mimetype="text/restructuredtext" |
50 | 50 | # .. note:: |
|
53 | 53 | # `matplotlib backend <https://matplotlib.org/faq/usage_faq#what-is-a-backend>`__ |
54 | 54 | # -- the default background color is white when the figure is saved. This is done |
55 | 55 | # by setting :rcraw:`figure.facecolor` to gray, in order to improve contrast |
56 | | -# when working with figures, similar to MATLAB. |
57 | | -# |
58 | | -# ProPlot also changes the default |
| 56 | +# when working with figures. ProPlot also changes the default |
59 | 57 | # :rcraw:`savefig.format` from PNG to PDF for the following reasons: |
60 | 58 | # |
61 | 59 | # #. Vector graphic formats are infinitely scalable. |
|
70 | 68 | # as the minimum resolution for rasterized figures containing lines and text. |
71 | 69 | # See the :ref:`configuration section <ug_proplotrc>` for how to change |
72 | 70 | # any of these settings. |
| 71 | +# |
| 72 | +# .. warning:: |
| 73 | +# |
| 74 | +# ProPlot enables "axis sharing" by default. This lets subplots in the same row or |
| 75 | +# column share the same axis limits, scales, ticks, and labels. This is often |
| 76 | +# convenient, but may be annoying for some users. To keep this feature turned off, |
| 77 | +# simply :ref:`change the default settings <ug_rc>` with e.g. |
| 78 | +# ``plot.rc.update(share=False, span=False)``. See :ref:`this section <ug_share>` |
| 79 | +# for details. |
73 | 80 |
|
74 | 81 | # %% |
75 | 82 | # Generate sample data |
|
181 | 188 | # ``format`` method. This is your one-stop-shop for changing axes settings. |
182 | 189 | # Keyword arguments passed to ``format`` are interpreted as follows: |
183 | 190 | # |
| 191 | +# .. rst-class:: dummy-line-break-class |
| 192 | +# |
184 | 193 | # 1. Any keyword matching the name of an `~proplot.config.rc` setting |
185 | 194 | # is used to update the axes. If the name has "dots", you can omit them |
186 | | -# (e.g. ``titleloc='left'`` to change the :rcraw:`title.loc` property). |
| 195 | +# (e.g., ``titleloc='left'`` changes the :rcraw:`title.loc` property). |
187 | 196 | # See the :ref:`configuration section <ug_config>` for details. |
| 197 | +# |
188 | 198 | # 2. Valid keywords arguments are passed to |
189 | 199 | # `proplot.axes.CartesianAxes.format`, `proplot.axes.PolarAxes.format`, or |
190 | 200 | # `proplot.axes.GeoAxes.format`. These change settings that are |
|
202 | 212 | # 3. Remaining keyword arguments are passed to the base `proplot.axes.Axes.format` |
203 | 213 | # method. `~proplot.axes.Axes` is the base class for all other axes classes. |
204 | 214 | # This changes things that are the same for all axes types, like titles and |
205 | | -# a-b-c subplot labels (e.g. ``title='Title'``). |
| 215 | +# a-b-c subplot labels (e.g., ``title='Title'``). |
206 | 216 | # |
207 | 217 | # The ``format`` methods let you use simple shorthands for changing all kinds |
208 | 218 | # of settings at once, instead of one-liner setter methods like |
209 | 219 | # ``ax.set_title()`` and ``ax.set_xlabel()``. They are also integrated with |
210 | 220 | # the `~proplot.constructor.Locator`, `~proplot.constructor.Formatter`, |
211 | | -# and `~proplot.constructor.Scale` constructor functions (see the |
212 | | -# :ref:`Cartesian axis settings <ug_cartesian>` section for details). |
| 221 | +# and `~proplot.constructor.Scale` :ref:`constructor functions <why_constructor>` |
| 222 | +# (see :ref:`this section <ug_cartesian>` for details). |
213 | 223 | # |
214 | 224 | # The below example shows the many different keyword arguments accepted by |
215 | 225 | # ``format``, and demonstrates how ``format`` can be used to succinctly and |
|
243 | 253 | # %% [raw] raw_mimetype="text/restructuredtext" |
244 | 254 | # .. _ug_container: |
245 | 255 | # |
246 | | -# Formatting all-at-once |
247 | | -# ---------------------- |
| 256 | +# Subplot containers |
| 257 | +# ------------------ |
248 | 258 | # |
249 | 259 | # Instead of an `~numpy.ndarray` of subplots, `~proplot.ui.subplots` returns a |
250 | 260 | # `~proplot.ui.SubplotsContainer`. This container behaves like an |
251 | 261 | # `~matplotlib.axes.Axes` object when it contains just one axes, and behaves |
252 | | -# like a list otherwise. It supports both 1D indexing (e.g. ``axs[1]``) and |
253 | | -# 2D indexing (e.g. ``axs[0, 1]``), and is row-major by default. Slicing a |
254 | | -# `~proplot.ui.SubplotsContainer` returns another container (e.g. ``axs[:, 0]``). |
| 262 | +# like a list otherwise. It supports both 1D indexing (e.g., ``axs[1]``) and |
| 263 | +# 2D indexing (e.g., ``axs[0, 1]``), and is row-major by default. Slicing a |
| 264 | +# `~proplot.ui.SubplotsContainer` returns another container (e.g., ``axs[:, 0]``). |
255 | 265 | # |
256 | 266 | # `~proplot.ui.SubplotsContainer` is useful because it lets you call |
257 | 267 | # `~proplot.axes.Axes` methods simultaneously for all subplots in the container. |
|
281 | 291 | # %% [raw] raw_mimetype="text/restructuredtext" |
282 | 292 | # .. _ug_rc: |
283 | 293 | # |
284 | | -# Styles and settings |
| 294 | +# Settings and styles |
285 | 295 | # ------------------- |
286 | 296 | # |
287 | 297 | # A special object named `~proplot.config.rc` is created whenever you import |
|
0 commit comments