Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
151 commits
Select commit Hold shift + click to select a range
0422fbb
Initial pull request
lukelbd Sep 18, 2019
baabc93
Merge pull request #55 from lukelbd/2dlatlon-bug
lukelbd Oct 21, 2019
dc48320
Construct base class skeletons and add folder search funcs
lukelbd Oct 22, 2019
8a4956e
Move config files and standardize searching locations
lukelbd Oct 24, 2019
8addbd0
Code quality changes
lukelbd Oct 24, 2019
b48f147
Cleanup, flesh out base classes
lukelbd Oct 25, 2019
a64a18e
Default transform bugfix
lukelbd Oct 25, 2019
473c489
Define wrappers on BasemapAxes for consistency with CartopyAxes
lukelbd Oct 25, 2019
9b720aa
Update docs regarding .proplotrc
lukelbd Oct 25, 2019
3bffca3
Update rcdocs
lukelbd Oct 25, 2019
4425813
Merge branch 'master' into custom-cmaps-cycles
lukelbd Oct 25, 2019
e9b2bea
Implement colormap modifying features on classes
lukelbd Oct 28, 2019
771dddb
Cleanup
lukelbd Oct 28, 2019
d6cd771
Revert to old config file/folder layout
lukelbd Oct 28, 2019
42ef8c2
Fill default ~/.proplotrc file with commented out lines
lukelbd Oct 28, 2019
f835850
Rename rc categories
lukelbd Oct 28, 2019
f11c283
Cleanup
lukelbd Oct 28, 2019
33e384c
Rename rc dicts again
lukelbd Oct 28, 2019
1203055
Rename Colormap.copy() --> from_cmap(), cleanup
lukelbd Oct 28, 2019
4b6d1a5
Bugfix
lukelbd Oct 28, 2019
47dd70f
Segmentdata bugs
lukelbd Oct 28, 2019
fab23de
Cleanup and standardize names
lukelbd Oct 29, 2019
5974268
Make concatenate + copy non-static, misc bugfixes
lukelbd Oct 29, 2019
fd420c6
Remove duplicate reverse features, more misc bugfixes
lukelbd Oct 29, 2019
ceb98fd
Various bugfixes (from testing colors.ipynb)
lukelbd Oct 29, 2019
683c6d7
Address codacy complaints
lukelbd Oct 29, 2019
49ef944
Update docs, fix save methods, add __repr__
lukelbd Oct 29, 2019
a4b9b6d
Fix save() bug, tweak __repr__()
lukelbd Oct 30, 2019
fd79457
Unused import
lukelbd Oct 30, 2019
31439dd
Merge pull request #57 from lukelbd/custom-cmaps-cycles
lukelbd Oct 30, 2019
0fe3bfc
Add new classes to __all__
lukelbd Oct 30, 2019
e1712e7
Repair save() docs
lukelbd Oct 30, 2019
f32e950
Fix merge conflict
lukelbd Oct 30, 2019
923f6b4
Cleanup save() extensions table
lukelbd Oct 30, 2019
704c7d3
Merge branch 'master' into dualax-factoryfunc-fixes
lukelbd Oct 30, 2019
629cf55
Typo in save() docs
lukelbd Oct 30, 2019
5ae9b22
Fix sphinx links
lukelbd Oct 30, 2019
5e61499
Plural classes
lukelbd Oct 30, 2019
26fae3b
Rename Colormap.copy --> Colormap.new, cleanup benchmarking code
lukelbd Oct 30, 2019
8984497
CmapDict docs
lukelbd Oct 30, 2019
894e454
ColorCacheDict docs
lukelbd Oct 30, 2019
89db9c0
ColorCacheDict docs
lukelbd Oct 30, 2019
200c2c9
Merge branch 'master' into dualax-factoryfunc-fixes
lukelbd Oct 30, 2019
774e7f8
Change back dualx/dualy syntax
lukelbd Oct 30, 2019
ee43c53
Fix bugs due to resetting scale at drawtime
lukelbd Oct 30, 2019
02bd8fe
Add back gridliner label warnings
lukelbd Oct 30, 2019
09ed143
Update notebooks
lukelbd Oct 30, 2019
f5eff48
Implement log/symlog formatter overrides on classes
lukelbd Oct 30, 2019
552a2a4
Merge pull request #52 from lukelbd/dualax-factoryfunc-fixes
lukelbd Oct 30, 2019
4a1247b
Use mixin _Scale class, better default dualx/y locators/formatters
lukelbd Oct 30, 2019
0ea6609
Dualx/y bugfix
lukelbd Oct 30, 2019
ef51e0f
Update cartesian axes examples
lukelbd Oct 31, 2019
a2708f6
Add ETA to README
lukelbd Oct 31, 2019
20a354c
Rename _Scale-->_ScaleBase
lukelbd Oct 31, 2019
633b0ad
Move notebooks folders
lukelbd Oct 31, 2019
53142b3
Colormap() converts input matplotlib cmaps to subclass
lukelbd Oct 31, 2019
170e51d
Remove commented out code from panels-to-parasites
lukelbd Oct 31, 2019
6e98b80
Fix CartopyAxes.text() bug
lukelbd Oct 31, 2019
b547de2
Fix lonlines bug
lukelbd Oct 31, 2019
d7430ba
Default cartopy transform bugfix
lukelbd Nov 1, 2019
9ce261b
Update geophysical data example
lukelbd Nov 1, 2019
1027fb3
Permit loading arbitrary colormap files
lukelbd Nov 6, 2019
86f35f1
Rename new() --> updated()
lukelbd Nov 11, 2019
b6fbd42
Merge branch 'master' into nbsphinx-docs
lukelbd Nov 13, 2019
56c945a
Restructure docs, add new pages
lukelbd Nov 13, 2019
f1f9c6f
Add git comments to why-proplot
lukelbd Nov 13, 2019
42d81f3
Why proplot section
lukelbd Nov 13, 2019
645ad8e
Why proplot
lukelbd Nov 15, 2019
4ca91e6
Various changes, fix Parameters tables
lukelbd Nov 16, 2019
20fb6f6
Update from stash
lukelbd Nov 16, 2019
010b1cc
Revert back to :parameters: so can list multiple params at once
lukelbd Nov 17, 2019
e285557
Add light theme stylesheet, remove unused rtd clone
lukelbd Nov 18, 2019
cda6963
Fix light theme sidebar
lukelbd Nov 18, 2019
a1e703b
Light mode final CSS edits
lukelbd Nov 18, 2019
b42fd81
Slightly darker background
lukelbd Nov 18, 2019
050e0eb
Make table colors grayscale
lukelbd Nov 18, 2019
63d1311
Contribute instructions
lukelbd Nov 18, 2019
20b4fdb
Lots of writing
lukelbd Nov 18, 2019
0e7940c
My hands are writing words
lukelbd Nov 18, 2019
d1ca33e
My hands are writing words
lukelbd Nov 18, 2019
67243e1
Initial commit of notebook files
lukelbd Nov 18, 2019
6749022
Use nbsphinx fork
lukelbd Nov 18, 2019
4a6e609
Set markdown cells to raw+RST, no more nbsphinx fork
lukelbd Nov 18, 2019
fc7747b
Travis CI
lukelbd Nov 18, 2019
45c6d5c
Link fixes, minor CSS changes, overview edits
lukelbd Nov 18, 2019
252244d
Parameter header edits
lukelbd Nov 18, 2019
d40a441
Add to quick overview, various other changes
lukelbd Nov 18, 2019
63cc63e
Links, better homepage, axistools cleanup
lukelbd Nov 19, 2019
43f7767
Quick overview and links cleanup
lukelbd Nov 19, 2019
5a53690
Split user guide notebooks into smaller sections
lukelbd Nov 19, 2019
c5e83a2
Contribution guide
lukelbd Nov 19, 2019
3288d58
proj.py docs
lukelbd Nov 19, 2019
c1f843a
API ref main page
lukelbd Nov 19, 2019
1a95106
Split up figure notebook sections
lukelbd Nov 19, 2019
4021238
Compare APIs in why-proplot, not user guide
lukelbd Nov 19, 2019
9c0781a
Split color usage notebook into 3 notebooks
lukelbd Nov 19, 2019
c12451c
Rename the axes classes
lukelbd Nov 19, 2019
c3a1aa5
Better admonition blocks, fix broken links
lukelbd Nov 19, 2019
120501c
Thinner tables, docs cleanup
lukelbd Nov 19, 2019
1060158
External links
lukelbd Nov 19, 2019
d0db1bf
Docs cleanup, add manifest, add INSTALL.rst
lukelbd Nov 20, 2019
0148841
Why proplot
lukelbd Nov 20, 2019
f28706f
Misc docs changes
lukelbd Nov 20, 2019
b270941
Fix notebook links, rename cmapline --> parametric
lukelbd Nov 20, 2019
cbb956b
Add parametric method to docs
lukelbd Nov 20, 2019
a1330ef
Fix wrapper docs links
lukelbd Nov 20, 2019
5459654
Fix sidebar colors for deeply nested entries
lukelbd Nov 20, 2019
33074ee
Figures notebook cleanup
lukelbd Nov 20, 2019
3015729
Tight layout notebook
lukelbd Nov 20, 2019
3554b57
Remove add-subplot workflow refs, fix sidebar colors/buttons
lukelbd Nov 20, 2019
7b49a86
Remove remaining add-subplot refs
lukelbd Nov 21, 2019
7b07b4a
subplots() docstring
lukelbd Nov 21, 2019
97d4ec7
Dark/light mode toggle (!), zerotrim bugfix
lukelbd Nov 24, 2019
0da79e3
API page changes
lukelbd Nov 24, 2019
a9673e5
Minor changes
lukelbd Nov 24, 2019
3f7f337
Stop documenting Circle() func
lukelbd Nov 24, 2019
4631ee7
Really fix zerotrim
lukelbd Nov 24, 2019
d3b0f0b
Faq, overview, fix links, align nbsphinx output
lukelbd Nov 24, 2019
f99fbdc
Dark/light mode toggles pygments stylesheet (!)
lukelbd Nov 24, 2019
c922439
Fix dark-light toggler
lukelbd Nov 24, 2019
bccf8d7
Use rubric:: for API page subheaders
lukelbd Nov 24, 2019
76c79e5
Style tweaks, misc changes
lukelbd Nov 24, 2019
ef7843e
Style tweaks, misc changes
lukelbd Nov 24, 2019
29ea57e
Use local pygment css files, cleanup, tweaks
lukelbd Nov 24, 2019
75ce94f
Test
lukelbd Nov 24, 2019
506c491
Larger fonts in examples, docs cleanup, custom_roles cleanup, misc bu…
lukelbd Nov 25, 2019
6b79f2f
Clean notebook output
lukelbd Nov 25, 2019
f47345d
Update contribution instructions
lukelbd Nov 25, 2019
98f9652
Fix merge conflict
lukelbd Nov 25, 2019
d6a7c5a
Stylesheet bugfixes
lukelbd Nov 25, 2019
fb64eb0
Overview, faq, why proplot
lukelbd Nov 25, 2019
8bbe050
Remove units section
lukelbd Nov 25, 2019
efb4475
Why proplot
lukelbd Nov 25, 2019
e43db85
Why proplot
lukelbd Nov 25, 2019
cebc74e
Why proplot
lukelbd Nov 25, 2019
62d94e0
Codacy complaints
lukelbd Nov 25, 2019
2c1e3e1
Why and overview
lukelbd Nov 25, 2019
6736ea6
Overview and why-proplot, split nb_setup() into 3 funcs
lukelbd Nov 26, 2019
e9e8634
Why proplot
lukelbd Nov 26, 2019
53aff70
Code qaulity, Colormap.from_list improvements, cyclic + transparent m…
lukelbd Nov 27, 2019
b08e52d
Merge branch 'master' into nbsphinx-docs
lukelbd Nov 27, 2019
1f4ba46
Physical units descrip
lukelbd Nov 27, 2019
f1d2e9d
Physical units
lukelbd Nov 27, 2019
0d5127e
Remove 'default' formatter, code quality fixes
lukelbd Nov 27, 2019
acffc34
Use setuptools_scm, no more hardcoded version / MANIFEST
lukelbd Nov 27, 2019
8743b85
Travis fix (just notebooks for now)
lukelbd Nov 27, 2019
b49f54f
Fix sphinx-build requirements
lukelbd Nov 27, 2019
ab0ca7e
Use conda for documentation build reqs
lukelbd Nov 27, 2019
c7dbcae
Fix conda activate
lukelbd Nov 27, 2019
d34d888
Fix proplot not found issue
lukelbd Nov 27, 2019
0c6d581
Bugfix (travis caught it! awesome!)
lukelbd Nov 27, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Cleanup
  • Loading branch information
lukelbd committed Oct 28, 2019
commit f11c28354277f078d315c0917831c33629c91961
140 changes: 61 additions & 79 deletions proplot/rctools.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

1. Builtin matplotlib `rcParams <https://matplotlib.org/users/customizing.html>`__
settings. These have the format ``x.y`` or ``x.y.z``.
2. ProPlot :ref:`rcExtra` settings. These also have the format ``x.y``
2. ProPlot :ref:`rcCustom` settings. These also have the format ``x.y``
(see below).
3. ProPlot :ref:`rcShort` settings. These have no dots (see below).

Expand Down Expand Up @@ -82,7 +82,7 @@
================ ====================================================================================================================================================================================================================================

#############
rcExtra
rcCustom
#############
The ``subplots`` category controls the default layout for figures
and axes. The ``abc``, ``title``, and ``tick`` categories control
Expand Down Expand Up @@ -209,21 +209,14 @@
# Initialize
from matplotlib import rcParams as rcParams
rcShort = {}
rcExtra = {}
rcCustom = {}

# "Global" settings and the lower-level settings they change
# NOTE: This whole section, declaring dictionaries and sets, takes 1ms
RCGLOBALS_CHILDREN = {
'abc': (),
'span': (),
'share': (),
'align': (),
'tight': (),
RC_CHILDREN = {
'fontname': ('font.family',),
'cmap': ('image.cmap',),
'lut': ('image.lut',),
'cycle': (),
'rgbcycle': (),
'alpha': ('axes.alpha',), # this is a custom setting
'facecolor': ('axes.facecolor', 'geoaxes.facecolor'),
'color': ('axes.edgecolor', 'geoaxes.edgecolor', 'axes.labelcolor', 'tick.labelcolor', 'hatch.color', 'xtick.color', 'ytick.color'), # change the 'color' of an axes
Expand All @@ -237,26 +230,18 @@
'ticklen' : ('xtick.major.size', 'ytick.major.size'),
'tickdir': ('xtick.direction', 'ytick.direction'),
'tickpad': ('xtick.major.pad', 'xtick.minor.pad', 'ytick.major.pad', 'ytick.minor.pad'),
'tickratio': (),
'ticklenratio': (),
'gridratio': (),
'reso': (),
'land': (),
'ocean': (),
'lakes': (),
'coast': (),
'borders': (),
'innerborders': (),
'rivers': (),
'nbsetup': (),
'format': (),
'autosave': (),
'autoreload': (),
}

# Names of the new settings
RC_NAMES = {*rcParams.keys()}
RC_GLOBALNAMES = {*RCGLOBALS_CHILDREN.keys()}
RC_PARAMNAMES = {*rcParams.keys()}
RC_SHORTNAMES = {
'abc', 'span', 'share', 'align', 'tight', 'fontname', 'cmap', 'lut',
'cycle', 'rgbcycle', 'alpha', 'facecolor', 'color', 'small', 'large',
'linewidth', 'margin', 'grid', 'gridminor', 'geogrid',
'ticklen' , 'tickdir', 'tickpad', 'tickratio', 'ticklenratio', 'gridratio',
'reso', 'land', 'ocean', 'lakes', 'coast', 'borders', 'innerborders', 'rivers',
'nbsetup', 'format', 'autosave', 'autoreload'
}
RC_CUSTOMNAMES = {
'axes.formatter.zerotrim', 'axes.formatter.timerotation',
'axes.gridminor', 'axes.geogrid', 'axes.alpha',
Expand Down Expand Up @@ -285,36 +270,35 @@
# way less verbose. For example, landcolor='b' vs. rc_kw={'land.color':'b'}.
RC_NODOTSNAMES = { # useful for passing these as kwargs
name.replace('.', ''):name for names in
(RC_CUSTOMNAMES, RC_NAMES, RC_GLOBALNAMES)
(RC_CUSTOMNAMES, RC_PARAMNAMES, RC_SHORTNAMES)
for name in names
}
# Categories for returning dict of subcategory properties
RC_CATEGORIES = {
*(re.sub('\.[^.]*$', '', name) for names in (RC_CUSTOMNAMES, RC_NAMES) for name in names),
*(re.sub('\..*$', '', name) for names in (RC_CUSTOMNAMES, RC_NAMES) for name in names)
*(re.sub('\.[^.]*$', '', name) for names in (RC_CUSTOMNAMES, RC_PARAMNAMES) for name in names),
*(re.sub('\..*$', '', name) for names in (RC_CUSTOMNAMES, RC_PARAMNAMES) for name in names)
}

# Unit conversion
# See: https://matplotlib.org/users/customizing.html, all props matching
# the below strings use the units 'points', and my special categories are inches!
UNITS_REGEX = re.compile('^.*(width|space|size|pad|len|small|large)$') # len is for ticklen, space is for subplots props
def _convert_units(key, value):
"""Converts certain keys to the units "points". If "key" is passed, tests
that key against possible keys that accept physical units."""
# WARNING: Must keep colorbar and subplots units alive, so when user
# requests em units, values change with respect to font size. The points
# thing is a conveniene feature so not as important for them.
if isinstance(value,str) and UNITS_REGEX.match(key) \
and key.split('.')[0] not in ('colorbar','subplots'):
value = utils.units(value, 'pt')
if (isinstance(value,str) and key.split('.')[0] not in ('colorbar','subplots')
and re.match('^.*(width|space|size|pad|len|small|large)$', key)):
value = utils.units(value, 'pt')
return value

def _set_cycler(name):
"""Sets the default color cycler."""
# Draw from dictionary
try:
colors = mcm.cmap_d[name].colors
except Exception:
except (KeyError, AttributeError):
cycles = sorted(name for name,cmap in mcm.cmap_d.items() if isinstance(cmap, mcolors.ListedColormap))
raise ValueError(f'Invalid cycle name {name!r}. Options are: {", ".join(cycles)}')
# Apply color name definitions
Expand Down Expand Up @@ -356,9 +340,9 @@ def _get_config_paths():
paths.insert(0, ipath)
return paths

def _get_globals(key=None, value=None):
def _get_synced_params(key=None, value=None):
"""Returns dictionaries for updating "child" properties in
`rcParams` and `rcExtra` with global property."""
`rcParams` and `rcCustom` with global property."""
kw = {} # builtin properties that global setting applies to
kw_custom = {} # custom properties that global setting applies to
if key is not None and value is not None:
Expand Down Expand Up @@ -396,17 +380,17 @@ def _get_globals(key=None, value=None):
ratio = value
kw_custom['gridminor.linewidth'] = gridwidth*ratio
# Now update linked settings
if key not in ('gridratio','tickratio','ticklenratio'):
for name in RCGLOBALS_CHILDREN[key]:
val = _convert_units(key, value)
if name in rcExtra:
kw_custom[name] = val
else:
kw[name] = val
if key == 'linewidth' and val == 0:
ikw, ikw_custom = _get_globals('ticklen', 0)
kw.update(ikw)
kw_custom.update(ikw_custom)
val = None
for name in RC_CHILDREN.get(key, ()):
val = _convert_units(key, value)
if name in rcCustom:
kw_custom[name] = val
else:
kw[name] = val
if key == 'linewidth' and val == 0:
ikw, ikw_custom = _get_synced_params('ticklen', 0)
kw.update(ikw)
kw_custom.update(ikw_custom)
return kw, kw_custom

class rc_configurator(object):
Expand All @@ -418,14 +402,14 @@ def __str__(self):
def __repr__(self):
return type(rcParams).__repr__(rcShort)
def __contains__(self, key):
return (key in RC_GLOBALNAMES or key in RC_CUSTOMNAMES or key in
RC_NAMES or key in RC_NODOTSNAMES) # query biggest lists last
return (key in RC_SHORTNAMES or key in RC_CUSTOMNAMES or key in
RC_PARAMNAMES or key in RC_NODOTSNAMES) # query biggest lists last

@_counter # about 0.05s
def __init__(self):
"""Magical abstract class for managing matplotlib `rcParams
<https://matplotlib.org/users/customizing.html>`__ settings, ProPlot
:ref:`rcExtra` settings, and :ref:`rcShort` "global" settings.
:ref:`rcCustom` settings, and :ref:`rcShort` "global" settings.
When initialized, this loads defaults settings plus any user overrides
in the ``~/.proplotrc`` file. See the `~proplot.rctools` documentation
for details."""
Expand All @@ -447,40 +431,38 @@ def __init__(self):
# Special duplicate keys
if data is None:
continue
val = data.get('title.pad', None)
if val is not None:
data['axes.titlepad'] = val
# Add keys to dictionaries
gkeys, ckeys = {*()}, {*()}
for key,value in data.items():
if key in RC_GLOBALNAMES:
if key in RC_SHORTNAMES:
rcShort[key] = value
if i == 0:
gkeys.add(key)
elif key in RC_CUSTOMNAMES:
value = _convert_units(key, value)
rcExtra[key] = value
rcCustom[key] = value
if i == 0:
ckeys.add(key)
elif key in RC_NAMES:
elif key in RC_PARAMNAMES:
value = _convert_units(key, value)
rcParams[key] = value
else:
raise RuntimeError(f'{file!r} has invalid key {key!r}.')
# Make sure we did not miss anything
if i == 0:
if gkeys != RC_GLOBALNAMES:
raise RuntimeError(f'{file!r} has incomplete or invalid global keys {RC_GLOBALNAMES - gkeys}.')
if gkeys != RC_SHORTNAMES:
raise RuntimeError(f'{file!r} has incomplete or invalid global keys {RC_SHORTNAMES - gkeys}.')
if ckeys != RC_CUSTOMNAMES:
raise RuntimeError(f'{file!r} has incomplete or invalid custom keys {RC_CUSTOMNAMES - ckeys}.')

# Apply *global settings* to children settings
rcParams['axes.titlepad'] = rcCustom['title.pad']
_set_cycler(rcShort['cycle'])
rc, rc_new = _get_globals()
rc, rc_new = _get_synced_params()
for key,value in rc.items():
rcParams[key] = value
for key,value in rc_new.items():
rcExtra[key] = value
rcCustom[key] = value

# Caching stuff
self._init = True
Expand All @@ -492,26 +474,26 @@ def __init__(self):

def __getitem__(self, key):
"""Returns `rcParams <https://matplotlib.org/users/customizing.html>`__,
:ref:`rcExtra`, and :ref:`rcShort` settings. If we are in a
:ref:`rcCustom`, and :ref:`rcShort` settings. If we are in a
`~rc_configurator.context` block, may return ``None`` if the setting
is not cached (i.e. if it was not changed by the user)."""
# Can get a whole bunch of different things
# Get full dictionary e.g. for rc[None]
if not key:
return {**rcParams, **rcExtra}
return {**rcParams, **rcCustom}

# Standardize
# NOTE: If key is invalid, raise error down the line.
if '.' not in key and key not in rcShort:
key = RC_NODOTSNAMES.get(key, key)

# Allow for special time-saving modes where we *ignore rcParams*
# or even *ignore rcExtra*.
# or even *ignore rcCustom*.
mode = self._getitem_mode
if mode == 0:
kws = (self._cache, rcShort, rcExtra, rcParams)
kws = (self._cache, rcShort, rcCustom, rcParams)
elif mode == 1:
kws = (self._cache, rcShort, rcExtra) # custom only!
kws = (self._cache, rcShort, rcCustom) # custom only!
elif mode == 2:
kws = (self._cache,) # changed only!
else:
Expand All @@ -532,7 +514,7 @@ def __getitem__(self, key):

def __setitem__(self, key, value):
"""Sets `rcParams <https://matplotlib.org/users/customizing.html>`__,
:ref:`rcExtra`, and :ref:`rcShort` settings."""
:ref:`rcCustom`, and :ref:`rcShort` settings."""
# Check whether we are in context block
# NOTE: Do not add key to cache until we are sure it is a valid key
cache = self._cache
Expand Down Expand Up @@ -610,22 +592,22 @@ def __setitem__(self, key, value):
restore[key] = rcShort[key]
rcShort[key] = value
# Update children of setting
rc, rc_new = _get_globals(key, value)
rc, rc_new = _get_synced_params(key, value)
cache.update(rc)
cache.update(rc_new)
if context:
restore.update({key:rcParams[key] for key in rc})
restore.update({key:rcExtra[key] for key in rc_new})
restore.update({key:rcCustom[key] for key in rc_new})
rcParams.update(rc)
rcExtra.update(rc_new)
rcCustom.update(rc_new)
# Update normal settings
elif key in RC_CUSTOMNAMES:
value = _convert_units(key, value)
cache[key] = value
if context:
restore[key] = rcExtra[key]
rcExtra[key] = value
elif key in RC_NAMES:
restore[key] = rcCustom[key]
rcCustom[key] = value
elif key in RC_PARAMNAMES:
value = _convert_units(key, value)
cache[key] = value
if context:
Expand Down Expand Up @@ -708,10 +690,10 @@ def context(self, *args, mode=0, **kwargs):
ProPlot uses all of the three available modes.

0. All settings (`rcParams <https://matplotlib.org/users/customizing.html>`__,
:ref:`rcExtra`, and :ref:`rcShort`) are returned, whether
:ref:`rcCustom`, and :ref:`rcShort`) are returned, whether
or not `~rc_configurator.context` has changed them.
1. Unchanged `rcParams <https://matplotlib.org/users/customizing.html>`__
return ``None``. :ref:`rcExtra` and :ref:`rcShort` are
return ``None``. :ref:`rcCustom` and :ref:`rcShort` are
returned whether or not `~rc_configurator.context` has changed them.
This is used in the `~proplot.axes.Axes.__init__` call to
`~proplot.axes.Axes.format`. When a setting lookup returns
Expand Down Expand Up @@ -811,11 +793,11 @@ def category(self, cat, cache=True):
mode = self._getitem_mode

# Allow for special time-saving modes where we *ignore rcParams*
# or even *ignore rcExtra*.
# or even *ignore rcCustom*.
if mode == 0:
kws = (self._cache, rcShort, rcExtra, rcParams)
kws = (self._cache, rcShort, rcCustom, rcParams)
elif mode == 1:
kws = (self._cache, rcShort, rcExtra)
kws = (self._cache, rcShort, rcCustom)
elif mode == 2:
kws = (self._cache, rcShort)
else:
Expand Down