context(*args, mode=0, file=None, **kwargs)¶
Temporarily modify the rc settings in a “with as” block.
- Other Parameters
The options are as follows:
Unchanged matplotlib settings return
None. All of ProPlot’s added settings are returned whether or not
contexthas changed them. This is used in the
format. When a lookup returns
formatdoes not apply it.
All unchanged settings return
None. This is used during user calls to
This is used by ProPlot internally but may also be useful for power users. It was invented to prevent successive calls to
formatfrom constantly looking up and re-applying unchanged settings. These gratuitous lookups increased runtime significantly, and resulted in successive calls to
formatoverwriting the previous calls.
The below applies settings to axes in a specific figure using
>>> import proplot as plot >>> with plot.rc.context(linewidth=2, ticklen=5): >>> fig, ax = plot.subplots() >>> ax.plot(data)
>>> import proplot as plot >>> fig, ax = plot.subplots() >>> ax.format(linewidth=2, ticklen=5)