-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Grid disappear after pcolormesh apply #15600
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
The grid seems to be turned off deliberately matplotlib/lib/matplotlib/axes/_axes.py Line 6173 in 014aa5b
I don't know if there is any specific reason for that? |
Weird. It’s been like that for 14 years though, so may be hard to change? |
Looks like pcolor() does the same, and has basically always done so. |
Could it be that this serves the purpose of overriding Anyway should |
As a suggestion, maybe add another |
Actually I occasionally do want grids on my images.
In that case I would suggest just disabling the grid yourself with |
Agreed.
Agreed. However, we need the possibility to have a style with gridded regular axes, but no grids on false-color plots. That's a reasonable combination of defaults. Moreover, that's how current styles are rendered, and we cannot request ggplot-style or seaborn-style users to add Since an Axes does not know it will be filled with a false-color plot at creation time, I don't think there is a way around calling |
If we're going to make the user add a kwarg to each call I don't see how that's better than requesting that the user calls grid(False) first. Also note that imshow() doesn't have that behavior, even though it's arguably in the same category of plots. |
I don’t think any individual artists should set axes properties. If it weren’t for back compatibility concerns I’d vote to change this |
For backward compatibility, the default would of course stay to deactivate the grid. |
My point is that this can actually be changed with a proper deprecation transition (check whether the grid was set, and if so, warn that pcolormesh won't unset it for you anymore in the future). |
It's the |
Bug report
Bug summary
Grid disappear after pcolormesh apply

Code for reproduction
Expected outcome
Grid must be visible, but if you apply a pcolormesh after to set grid to True, grid disapear?
Matplotlib version
I install library with conda with no options:
conda install matplotlib
The text was updated successfully, but these errors were encountered: