Closed tomasrojasc closed 10 months ago
I can´t reproduce, on Google Colab nor in VS Code. Can you provide your code editor? And do you mind double checking the output on a whole new and clean project/notebook?
It only comes to my mind that your environment sets matplotlib to use a style that by default. Btw, try updating matplotlib and the ipython kernels.
EDIT: can you show the output without any styles applied?
Hi, yes something is odd, without any styles I get this: https://imgur.com/a/Wpfwvq6
Which seems the default seaborn template... although I haven't even imported seaborn.
EDIT: I am using kedro as framework and pycharm as editor
Two things:
mpl.rcParams
or plt.rcParams
and that will throw the dictionary with all config from the applied styles. Unluckily matplotlib does not save your current styles.
Call that from a terminal and from inside PyCharm without making use of plt.style.use(...)
. That way you can compare both and tell if PyCharm is introducing its styles by default. You may want to use an script to compare those dictionaries. And if you think seaborn matches that, import it with the use
statement and check.rcParams
with:
import matplotlib as mpl
mpl.rcParams.update(mpl.rcParamsDefault)
If you find something or this works, pls, let us know!
Apparently PyCharm does introduce an style, I have it almost working, what I done is I first set the default config of matplotlib, then the science style, and now I get this: https://imgur.com/a/AwHOcFY
So now I am only missing the colors! Hopefully, although after I have more complex plots that may introduce styles since I heavily rely on seaborn... But one step at a time.
Nice! I'll close this issue since the main problem has been solved.
science
style does indeed change the default colors via plt.rcParams['axes.prop_cycle']
.
plt.rcParams['axes.prop_cycle'] = plt.rcParamsDefault['axes.prop_cycle']
And see this comment.
Thank you very much for your help and fast responses!
Environment
Describe your issue here
When I use any style of this package I do not get figures line in the README. I get similar figures but the ticks are only inside the plot in the right side and the top side, in the left and bottom there is no ticks at all. Also the default colors of matplotlib seem to be overwritten for another palette.
How can we reproduce it? What have you tried?
When I run this on a jupyter notebook, the output is a shown in the figure attached https://imgur.com/a/xFvZ5hD
Extra info
No response