Skip to content
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

import dtale changes matplotlib settings #703

Closed
BlackHC opened this issue Oct 25, 2022 · 2 comments
Closed

import dtale changes matplotlib settings #703

BlackHC opened this issue Oct 25, 2022 · 2 comments

Comments

@BlackHC
Copy link

BlackHC commented Oct 25, 2022

DTale is great. However, when I import it, it changes my matplotlib settings.

See https://cs.github.com/man-group/dtale/blob/3e8d1ce16406a84a9c7293589aa4a8f9b17fb78f/dtale/views.py#L25

import matplotlib

matplotlib.use("agg")  # noqa: E261

import matplotlib.pyplot as plt

plt.rcParams["font.sans-serif"] = ["SimHei"]  # Or any other Chinese characters
matplotlib.rcParams["font.family"] = ["Heiti TC"]

This is not great when using jupyter lab as suddently plots don't display correctly anymore (and I don't have the Heiti TC font, resulting in lots of warnings).

aschonfeld added a commit that referenced this issue Oct 28, 2022
@aschonfeld
Copy link
Collaborator

@BlackHC apologies for the issues. I'm working on trying to add some warning filtering and moving the import to within the function that uses it so that unless you use the function (exporting Correlation matrix images) then it shouldn't affect your jupyter sessions

aschonfeld added a commit that referenced this issue Nov 2, 2022
aschonfeld added a commit that referenced this issue Nov 4, 2022
@aschonfeld
Copy link
Collaborator

@BlackHC just released v2.9.0 with this fix. Please let me know how it goes. Also, if you haven't already, please toss your ⭐ on the repo when you get a chance. Thanks 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants