Skip to content

Default locator for log-scale messes up minor ticks sometimes #7200

Closed

Description

@LindyBalboa

Ubuntu 16.04 | Python 3.5 | MPL 2.0.0b3.post2474+gf8d05a4

Don't have time to look into this more right now. You can see it gets it right sometimes, but sometimes it is very wrong.

screenshot from 2016-09-29 11-13-57

Activity

  1. efiring commented on Sep 29, 2016

    @efiring
    Member

    It looks like the problem occurs when the major locator puts ticks at intervals of more than a decade. What should the minor ticks do in that case? I don't see an obvious solution, other than putting minor ticks at the decades when the major ticks are skipping decades. In the upper RHS plot in this example, the minor ticks would be at 10^-9 and 10^-7.

  2. added this to the milestone on Sep 29, 2016
  3. anntzer commented on Sep 29, 2016

    @anntzer
    Contributor

    Would it be a problem if a minor tick was always drawn at any position a major tick is drawn? (We just need to make sure that the major tick is drawn over the minor tick, if both are present.) This would also have avoided (somewhat) issues such as #6875 (comment).

  4. efiring commented on Sep 29, 2016

    @efiring
    Member

    That would make a mess, or more complexity to avoid the mess, in any case where minor ticks are labeled.

  5. anntzer commented on Sep 29, 2016

    @anntzer
    Contributor

    Good point.

  6. LindyBalboa commented on Oct 4, 2016

    @LindyBalboa
    ContributorAuthor

    Would it be possible to decouple label generation from the ticks? There should totally still be major ticks there, but on some of my plots (ylim of 10^-17 to 10^-4) were just way too crowded and ugly. I was in a rush and just posted the first plot that showed it, so maybe not the best example.

  7. tacaswell commented on Oct 4, 2016

    @tacaswell
    Member

    You might be able to shoe-horn some 'return an empty string' logic into LogFormatter

  8. NelleV commented on Nov 10, 2016

    @NelleV
    Member

    We've done a lot of work on the ticker module to improve the defaults recently, so it is possible this has been fixed. Do you mind sharing the data and the code so that I can verify we haven't fixed this already?

    Thanks,
    N

  9. self-assigned this
    on Nov 10, 2016
  10. efiring commented on Nov 10, 2016

    @efiring
    Member

    Not fixed on v2.x:

    import numpy as np
    import matplotlib.pyplot as plt
    x = np.logspace(-10, -5, 100)
    plt.loglog(x, x)
    plt.ylim(2.85e-14, 9.7e-3)
  11. modified the milestones: , on Nov 14, 2016
  12. modified the milestones: , on May 3, 2017
  13. modified the milestones: , on Oct 9, 2017
  14. afvincent commented on Nov 17, 2017

    @afvincent
    Contributor

    @efiring Is this still a problem with 2.1.x? Running your snippet, I get
    efirings_mwe_7200_with_2 1
    which looks kind of OK to me (i.e. no funny minor ticks between major y-ticks spanning over more than 1 decade). Or am I missing something?

    However kind of agree with the suggestion that adding an extra unlabelled tick at each decade between the labelled tick might be a good idea.

  15. efiring commented on Nov 17, 2017

    @efiring
    Member

    I think we can consider the behavior sufficiently improved by #8381 that the original issue is no longer present. Therefore I will close this.

  16. LindyBalboa commented on Nov 17, 2017

    @LindyBalboa
    ContributorAuthor

    Thanks for the continuing work guys!

  17. modified the milestones: , on Nov 17, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions