july
july copied to clipboard
make modifications of matplotlib configuration on a local level
In order to not interfere with other potential components relying on matplotlib and implicitly expecting some or all configurations, namely rcParams
, to have their respective default value, I would appreciate if changes to rcParams
only influenced july.
Currently, it is reconfigured globally in https://github.com/e-hulten/july/blob/953ef3ee20549ca791d88d2f08e54862aa4c2f58/src/july/rcmod.py#L55
One possibility to achieve this would be for update_rcparams
to use matplotlib.rc_context
– returning a new independent context manager, to be used in
https://github.com/e-hulten/july/blob/953ef3ee20549ca791d88d2f08e54862aa4c2f58/src/july/plot.py#L68
Sorry for the late reply. Very good suggestion, I fully agree!
The next version of july
will be using the
with plt.rc_context(rcmod):
...
context manager to avoid interfering with other plots and packages.