Skip to content

Feature Request: Allow setting default AutoMinorLocator #14233

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

Closed
getup8 opened this issue May 17, 2019 · 6 comments · Fixed by #18715
Closed

Feature Request: Allow setting default AutoMinorLocator #14233

getup8 opened this issue May 17, 2019 · 6 comments · Fixed by #18715
Labels
Good first issue Open a pull request against these issues if there are no active ones! New feature
Milestone

Comments

@getup8
Copy link

getup8 commented May 17, 2019

Via rcParams you can turn on minor ticks/grid for all your plots but there is currently no way to give a default interval for minor ticks to be shown.

AutoMinorLocator defaults to 4 or 5 so potentially it could check to see if this value is set in rcParams and use that first instead?

@timhoffm timhoffm added the Good first issue Open a pull request against these issues if there are no active ones! label May 18, 2019
@Adioosin
Copy link

Adioosin commented May 27, 2019

I would like to work on this issue. please guide me @dstansby @timhoffm what need to be done since it is my first contribution. From above i understood that rcParams is a global object which can be used across the module. In this we need to add the method to set a default value for ticker module and in the ticker module's AutoMinorLocator method we need to check if the default exist in the rcParams and use it. Please let me know if i understood it right or not and suggest if any corrections.

@timhoffm
Copy link
Member

Welcome to matplotlib!

General information how to contribute and setup your local development environment can be found at https://matplotlib.org/devel/contributing.html.

For this specific feature:

  • Come up with a reasonable parameter name and allowed values. In particular, these values should be the same as in AutoMinorLocator.__init__. But do we want to change the meaning of None there to mean "use rcParams"? If so we need a different value for "4-5".
  • Add a new entry in matplotlib.rcsetup.defaultParams and write a corresponding validator.
  • Add the new key to matplotlibrc.template.
  • use the parameter in AutoMinorLocator.__init__.
  • Write a test for the parameter.
  • Submit a pull request.

If you have questions, you can always ask here, or if it's easier also start with an incomplete PR and ask there in the context of your proposed code.

@JacobChamberlain
Copy link

I would like to work on this issue if it is available. I was thinking the best way to tackle it would be to add an rcParam for the tick count, or use one of the existing one (i don't think any of them tell us this though). Is it okay to add rcParams, or should I try a different approach?

@IlievskiV
Copy link
Contributor

Hi everyone, is this still a relevant issue? I think I gained a common sense from the provided comments and reading the code for AutoMinorLocator, so I could try to implement it.

@jklymak
Copy link
Member

jklymak commented Oct 10, 2020

@IlievskiV There is an open PR for this at #16762. Perhaps ping the author there if you are interested in taking this up?

@IlievskiV
Copy link
Contributor

@jklymak sure, I just did it. Thanks for the suggestion!

IlievskiV pushed a commit to IlievskiV/matplotlib that referenced this issue Oct 11, 2020
IlievskiV pushed a commit to IlievskiV/matplotlib that referenced this issue Oct 11, 2020
IlievskiV pushed a commit to IlievskiV/matplotlib that referenced this issue Oct 11, 2020
IlievskiV pushed a commit to IlievskiV/matplotlib that referenced this issue Oct 11, 2020
IlievskiV pushed a commit to IlievskiV/matplotlib that referenced this issue Oct 11, 2020
IlievskiV pushed a commit to IlievskiV/matplotlib that referenced this issue Oct 11, 2020
@jklymak jklymak modified the milestones: v3.4.0, v3.5.0 Feb 4, 2021
@QuLogic QuLogic modified the milestones: v3.5.0, v3.6.0 Aug 23, 2021
@QuLogic QuLogic modified the milestones: v3.6.0, v3.7.0 Aug 24, 2022
@QuLogic QuLogic removed this from the v3.7.0 milestone Jan 26, 2023
@QuLogic QuLogic added this to the future releases milestone Jan 26, 2023
tacaswell pushed a commit that referenced this issue May 24, 2023
Fixes #14233


Co-authored-by: Vladimir <vladimir@igenius.net>
Co-authored-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
@QuLogic QuLogic modified the milestones: future releases, v3.8.0 May 24, 2023
devRD pushed a commit to devRD/matplotlib that referenced this issue Jun 5, 2023
Fixes matplotlib#14233


Co-authored-by: Vladimir <vladimir@igenius.net>
Co-authored-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
melissawm pushed a commit to melissawm/matplotlib that referenced this issue Jun 15, 2023
Fixes matplotlib#14233


Co-authored-by: Vladimir <vladimir@igenius.net>
Co-authored-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Good first issue Open a pull request against these issues if there are no active ones! New feature
Projects
None yet
9 participants