-
-
Notifications
You must be signed in to change notification settings - Fork 383
Move overiding matplotlib RC to using a theme. #267
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
Comments
Is there any news on this? Is there a way to have different presets (or "styles"?) for (kernels started by) the Qt Console and for (kernels started by) the Notebook? I've also tried to get some information from the mailing list, but I didn't get a response: I've found out that the most meaningful BTW, I also don't think it makes sense (anymore?) to change the default I've made a notebook with a suggestion for an intermediate work-around: http://nbviewer.jupyter.org/github/mgeier/python-audio/blob/master/plotting/matplotlib-inline-defaults.ipynb But it would be great if that could be fixed in IPython itself! Here is an example that shows that plots using SVG and PNG with a setting of 96 DPI have about the same size: https://nbsphinx.readthedocs.io/en/latest/code-cells.html#Plots Here you can see the same thing for PDF and PNG plots when converted to LaTeX/PDF: https://media.readthedocs.org/pdf/nbsphinx/latest/nbsphinx.pdf#subsubsection.4.3.4 |
+1 to resolving this: at the moment you get the weird behavior that if you do |
I'd love to help with this -- I teach Python to beginners using Jupyter Notebook / JupyterLab, and using matplotlib is always a stumbling block. Interactive plots are finicky to set up and use, and inline ones are too small by default, so they require fiddling with rcParams, which isn't beginner friendly either. However, having downloaded the code and played around with it to figure out how it works, I'm not sure how switching to matplotlib styles is supposed to help, as claimed in OP:
If the hypothetical inline style sets Here's a quick demo showing that switching styles can still override previously set In [1]: import matplotlib as mpl
In [2]: import matplotlib.pyplot as plt
In [3]: mpl.rc("figure", dpi=150)
In [4]: mpl.rcParams["figure.dpi"]
Out[4]: 150.0
In [5]: plt.style.use("classic")
In [6]: mpl.rcParams["figure.dpi"]
Out[6]: 80.0 So again, not sure how using styles to set inline rcParams would enable users to set a preferred |
Slightly unrelated, for future reference -- this is where the inline rcParams actually get loaded by IPython: |
I believe this commit to |
Thx for flagging that @danieloliveira56 - and FYI for all, that commit is now in the current 0.1.6 release of mpl-inline. So an update to that package might be enough to close this issue, I think. |
This is old and I think solved, closing for now, please reopen if there's actually new actionable info. |
Right now we override matplotlib parameters when using inline:
ipykernel/ipykernel/pylab/config.py
Lines 45 to 59 in 29abbed
We can do better now that matplotlib have styles; It wil have 2 advantages:
The text was updated successfully, but these errors were encountered: