Skip to content

Commit 2bc9a03

Browse files
committed
Minor docs cleanup, update inlinefmt references
1 parent 9171415 commit 2bc9a03

File tree

6 files changed

+20
-19
lines changed

6 files changed

+20
-19
lines changed

docs/basics.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
# <https://matplotlib.org/faq/usage_faq#what-is-a-backend>`__ are light gray
5050
# (the :rcraw:`savefig.facecolor` applied to saved figures is still white).
5151
# Proplot also controls the appearance of figures in Jupyter notebooks
52-
# using the new :rcraw:`inlinefmt` setting, which is passed to
52+
# using the new :rcraw:`inlineformat` setting, which is passed to
5353
# `~proplot.config.config_inline_backend` on import. This
5454
# imposes a higher-quality default `"inline" format
5555
# <https://ipython.readthedocs.io/en/stable/interactive/plotting.html>`__
@@ -155,8 +155,8 @@
155155
suptitle='Simple subplot grid', title='Title',
156156
xlabel='x axis', ylabel='y axis'
157157
)
158-
# fig.save('example1.png') # save the figure
159-
# fig.savefig('example1.png') # alternative
158+
# fig.save('~/example1.png') # save the figure
159+
# fig.savefig('~/example1.png') # alternative
160160

161161

162162
# %%
@@ -176,8 +176,8 @@
176176
xlabel='xlabel', ylabel='ylabel'
177177
)
178178
axs[2].plot(data, lw=2)
179-
# fig.save('example2.png') # save the figure
180-
# fig.savefig('example2.png') # alternative
179+
# fig.save('~/example2.png') # save the figure
180+
# fig.savefig('~/example2.png') # alternative
181181

182182

183183
# %%
@@ -198,8 +198,8 @@
198198
xlabel='xlabel', ylabel='ylabel', abc=True
199199
)
200200
axs[0].plot(data, lw=2)
201-
# fig.save('example3.png') # save the figure
202-
# fig.savefig('example3.png') # alternative
201+
# fig.save('~/example3.png') # save the figure
202+
# fig.savefig('~/example3.png') # alternative
203203

204204
# %%
205205
# Using a GridSpec
@@ -217,8 +217,8 @@
217217
suptitle='Subplot grid with a GridSpec',
218218
xlabel='xlabel', ylabel='ylabel', abc=True
219219
)
220-
# fig.save('example4.png') # save the figure
221-
# fig.savefig('example4.png') # alternative
220+
# fig.save('~/example4.png') # save the figure
221+
# fig.savefig('~/example4.png') # alternative
222222

223223
# %% [raw] raw_mimetype="text/restructuredtext"
224224
# .. _ug_subplotgrid:

proplot/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
except pkg.DistributionNotFound:
1111
version = __version__ = 'unknown'
1212

13-
# Import optional dependencies now to isolate import times
13+
# Import dependencies early to isolate import times
14+
from . import internals, externals, tests # noqa: F401
1415
from .internals.benchmarks import _benchmark
1516
with _benchmark('pyplot'):
1617
from matplotlib import pyplot # noqa: F401

proplot/config.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -367,17 +367,17 @@ def config_inline_backend(fmt=None):
367367
368368
.. code-block:: ipython
369369
370-
%config InlineBackend.figure_formats = rc['inlinefmt']
370+
%config InlineBackend.figure_formats = rc['inlineformat']
371371
%config InlineBackend.rc = {} # never override rc settings
372372
%config InlineBackend.close_figures = True # cells start with no active figures
373373
%config InlineBackend.print_figure_kwargs = {'bbox_inches': None}
374374
375375
When the inline backend is inactive or unavailable, this has no effect.
376-
This function is called when you modify the :rcraw:`inlinefmt` property.
376+
This function is called when you modify the :rcraw:`inlineformat` property.
377377
378378
Parameters
379379
----------
380-
fmt : str or sequence, default: :rc:`inlinefmt`
380+
fmt : str or sequence, default: :rc:`inlineformat`
381381
The inline backend file format or a list thereof. Valid formats
382382
include ``'jpg'``, ``'png'``, ``'svg'``, ``'pdf'``, and ``'retina'``.
383383
@@ -389,7 +389,7 @@ def config_inline_backend(fmt=None):
389389
ipython = get_ipython()
390390
if ipython is None:
391391
return
392-
fmt = _not_none(fmt, rc_proplot['inlinefmt'])
392+
fmt = _not_none(fmt, rc_proplot['inlineformat'])
393393
if isinstance(fmt, str):
394394
fmt = [fmt]
395395
elif np.iterable(fmt):
@@ -942,7 +942,7 @@ def _get_item_dicts(self, key, value, skip_cycle=False):
942942
raise KeyError(f'Invalid rc setting {key!r}.')
943943

944944
# Special key: configure inline backend
945-
if contains('inlinefmt'):
945+
if contains('inlineformat'):
946946
config_inline_backend(value)
947947

948948
# Special key: apply stylesheet

proplot/gridspec.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@
7777
wequal, hequal, equal : bool, default: :rc:`subplots.equalspace`
7878
Whether to make the tight layout algorithm apply equal spacing
7979
between columns, rows, or both.
80-
wgroup, hgroup, group : bool, default: :rc:`subplot.groupspace`
80+
wgroup, hgroup, group : bool, default: :rc:`subplots.groupspace`
8181
Whether to make the tight layout algorithm just consider spaces between
8282
adjacent subplots instead of entire columns and rows of subplots.
8383
outerpad : unit-spec, default: :rc:`subplots.outerpad`

proplot/internals/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ def _pop_props(input, *categories, prefix=None, ignore=None, skip=None):
335335
if any(string in key for string in ignore):
336336
warnings._warn_proplot(f'Ignoring property {key}={prop!r}.')
337337
continue
338-
if isinstance(prop, str):
338+
if isinstance(prop, str): # ad-hoc unit conversion
339339
if key in ('fontsize',):
340340
from ..utils import _fontsize_to_pt
341341
prop = _fontsize_to_pt(prop)

proplot/internals/rcsetup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1115,8 +1115,8 @@ def copy(self):
11151115
_validate_int,
11161116
'Native `~matplotlib.colors.ListedColormap`\\ s with more colors than '
11171117
'this are converted to `~proplot.colors.ContinuousColormap` rather than '
1118-
'`~proplot.colors.DiscreteColormap`. This helps translate perceptually '
1119-
'uniform colormaps from other projects registered as ListedColormap.'
1118+
'`~proplot.colors.DiscreteColormap`. This helps translate continuous '
1119+
'colormaps from external projects.'
11201120
),
11211121
'cmap.lut': (
11221122
256,

0 commit comments

Comments
 (0)