-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Global rcParams change on import #81
Comments
Thanks for the issue @OnDraganov. Absolutely! I agree that this shouldn't be set as a global. I believe we only use TeX for subscripts and superscripts in a mathematician friendly way. I think the context manager |
I've just encountered the same problem. If TeX is only used for subscripts and superscripts, it might not be necessary at all? Unless you use specific characters with which it may not work? |
@maximelucas The layers of the landscapes (indexed over |
I tried and r$\lambda_{2}$ actually shows correctly even with |
Yes most of the time it works even without the "r" in front. |
In
persim/landscapes/visuals.py
, line 15 definesmpl.rcParams["text.usetex"] = True
. This means that whenever we importpersim
, the behavior ofpyplot
changes to that setting in all thepyplot
uses. This is undesirable, as the user might prefer the defaultpyplot
options for other uses than calls throughpersim
.If TeX rendering is necessary for the plots, is it possible to do the change only locally whenever a plot is created? It could be done using
with mpl.rc_context({"text.usetex": True}):
construction or by passingusetex=True
at the individual places where it is desired.The text was updated successfully, but these errors were encountered: