-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Impossible to configure minor/major grid line style independently in rcParams #13919
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
There are no separate parameters for major/minor grid properties in You can currently only configure them programmatically.
|
I was just looking for exactly this feature. I already did it programmatically before, but as I have a large number of different plots with major and minor gridlines, this is quite inconvenient. Looking forward such an option in rcParams! |
Yes, PLEASE. I'm with @NGJROMO. This is back to one year ago. Is there any way it can be implemented soon? Thanks. |
I'm surprised that the settings are not automatically mirrored in the style sheet & rcParams. In fact, I would have thought that all of the defaults would be set up in rcParams & that would drive everything else. |
Bumping this issue -- I've found it unwieldy to copy and paste the same code snippet to get a fixed style that I almost always want, and would also appreciate support for differently styled major and minor gridlines via rc params. |
A motivated user could always write a PR for this. https://matplotlib.org/stable/devel/contributing.html However, be aware that new rcparams face a relatively high bar for acceptance. One can also write their own styling wrapper if they are always doing this. import matplotlib.pyplot as plt
my_style_subplots(*arg, **kwargs):
fig, axs = plt.subplots(*args, **kwargs)
for ax in axs.flat:
ax.xaxis.set_minor_locator(MultipleLocator(0.5))
ax.grid(which='both')
ax.tick_params(which='minor', grid_linestyle='--')
return fig, axs import mystyles as myplt
fig, ax = mplt.subplots(3, 2, sharedx=True) |
Sorry but above answer isn't satisfactory IMHO. That is not what we are asking. Also, it forces ax.xaxis.set_minor_locator(MultipleLocator(0.5)), which I would not want in general. This is a straightforward request and not hard to implement. It's from 2019 for crying out loud. |
Matplotlib is a volunteer organization and PRs are always welcome! |
I agree with @neutrinonerd3333, and am in the same boat as him and @zertrin. One other thing that I think is related, is the inability to specify tick label font in rcParams. I am able to specify the overall general font as Helvetica for example, successfully changing the font of everything in my generated plots, however this does not change the font of the tick labels (they remain in a serif font..)! I thought I could specify this in the rcParams (with something like font..ticklabel.family: sans-serif, font.ticklabel.serif: Helvetica), but it turns out this is another limitation that must be done programmatically... making each of my plots even more cumbersome and repetitive to code. |
This issue has been marked "inactive" because it has been 365 days since the last comment. If this issue is still present in recent Matplotlib releases, or the feature request is still wanted, please leave a comment and this label will be removed. If there are no updates in another 30 days, this issue will be automatically closed, but you are free to re-open or create a new issue if needed. We value issue reports, and this procedure is meant to help us resurface and prioritize issues that have not been addressed yet, not make them disappear. Thanks for your help! |
This is a highly requested feature. -> keep |
any updates on this? |
Still need this feature |
Good first issue - notes for new contributorsThis issue is suited to new contributors because it does not require understanding of the We do not assign issues. Check the Development section in the sidebar for linked pull If something is unclear, please reach out on any of our communication |
Maybe some extra tagging will help, but someone who wants this feature needs to propose a PR for it to get implemented. |
As a word of warning: This is not as trivial as it sounds. We want to maintain backward-compatibility, i.e. if somebody changes th |
Hi,
As far as I can see, the only customization to the grid that is possible right now in rcParams is:
Is it possible to change these keys so that it is possible to configure minor and major grid line styles independently from each other?
Something like:
The text was updated successfully, but these errors were encountered: