Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fix xtick.minor.visible only acting on the xaxis#12938

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation

ImportanceOfBeingErnest
Copy link
Member

@ImportanceOfBeingErnestImportanceOfBeingErnest commentedDec 6, 2018
edited
Loading

PR Summary

#10193 introduced a bug, that when the rc paramxtick.minor.visible is set toTrue, also the y-axis would get minor ticks.

import matplotlib.pyplot as pltplt.rcParams["xtick.minor.visible"] =  Trueplt.plot([1,2])plt.show()

minorticks_bug

This PR fixes this.
with this PR

minorticks_fixed

Interestingly though,plt.rcParams["ytick.minor.visible"] = True always worked fine. So in that sense I'm not sure if theScale would even need to set the locator the way it does.

PR Checklist

  • Has Pytest style unit tests
  • Code isFlake 8 compliant
  • New features are documented, with examples if plot related
  • Documentation is sphinx and numpydoc compliant
  • Added an entry to doc/users/next_whats_new/ if major new feature (follow instructions in README.rst there)
  • Documented in doc/api/api_changes.rst if API changed in a backward-incompatible way

@@ -69,7 +69,8 @@ def set_default_locators_and_formatters(self, axis):
axis.set_major_formatter(ScalarFormatter())
axis.set_minor_formatter(NullFormatter())
# update the minor locator for x and y axis based on rcParams
if rcParams['xtick.minor.visible']:
if axis.axis_name in list("xy") and \
rcParams['{}tick.minor.visible'.format(axis.axis_name)]:
Copy link
Member

@timhoffmtimhoffmDec 6, 2018
edited
Loading

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

IMHO this would be slightly more readable:

if (axis.axis_name == 'x' and rcParams['xtick.minor.visible']    or axis.axis_name == 'y' and rcParams['ytick.minor.visible']):

anntzer reacted with thumbs up emoji
Copy link
Member

@tacaswelltacaswell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Modulo adding a test.

Don't think we need an image test, just ask the axis if the minor ticks are turned on.

@ImportanceOfBeingErnest
Copy link
MemberAuthor

Test added.

@timhoffmtimhoffm merged commit4b0196e intomatplotlib:masterDec 10, 2018
meeseeksmachine pushed a commit to meeseeksmachine/matplotlib that referenced this pull requestDec 10, 2018
QuLogic added a commit that referenced this pull requestDec 10, 2018
…938-on-v3.0.xBackport PR#12938 on branch v3.0.x (Fix xtick.minor.visible only acting on the xaxis)
@ImportanceOfBeingErnestImportanceOfBeingErnest mentioned this pull requestDec 10, 2018
6 tasks
Stephen-Chilcote pushed a commit to Stephen-Chilcote/matplotlib that referenced this pull requestDec 11, 2018
raamana added a commit to raamana/matplotlib that referenced this pull requestDec 13, 2018
* upstream/master: (1723 commits)  Correctly get weight & style hints from certain newer Microsoft fonts (matplotlib#12945)  Remove some checks for Py<3.6 in the test suite. (matplotlib#12974)  Fail-fast when trying to run tests with too-old pytest.  Include scatter plots in Qt figure options editor. (matplotlib#12779)  ENH: replace deprecated numpy header  Minor simplifications.  tickminorvisible-fix (matplotlib#12938)  Remove animated=True from animation docs  Update the documentation of Cursor  Misc. cleanups.  Add test for 3d conversion of empty PolyCollection  Support ~ as nonbreaking space in mathtext.  Deprecate public use of Formatter.pprint_val.  MAINT: Unify calculation of normal vectors from polygons (matplotlib#12136)  Fix the title of testing_api  More table documentation  Simplify bachelors degree example using new features.  Avoid pyplot in showcase examples.  Simplify argument checking in Table.__getitem__. (matplotlib#12932)  Minor updates following bump to Py3.6+.  ...# Conflicts:#lib/matplotlib/widgets.py
@ImportanceOfBeingErnestImportanceOfBeingErnest deleted the tickminorvisible-fix branchFebruary 17, 2019 23:28
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@tacaswelltacaswelltacaswell approved these changes

@timhoffmtimhoffmtimhoffm approved these changes

Assignees
No one assigned
Projects
None yet
Milestone
v3.0.3
Development

Successfully merging this pull request may close these issues.

3 participants
@ImportanceOfBeingErnest@tacaswell@timhoffm

[8]ページ先頭

©2009-2025 Movatter.jp