Skip to content

Minor offsetText formatting improvement #4451

Open

Description

@anntzer

Currently, the axis offset text is always typeset with the format string "%1.10e" followed by some crazy postprocessing in ScalarFormatter._formatSciNotation. I would suggest switching to some "%g"-based format, so that e.g. 1234 doesn't get formatted as "1.234e3" which can hardly be described as "more legible". Probably _formatSciNotation could be simplified a bit too.

Simple example:

python -c 'from pylab import *; plot(*[1234 + arange(10)] * 2); show()'

Edit: the above is now fixed by the switch of axes.formatter.offset_threshold to 4, but the issue remains with

python -c 'from pylab import *; plot(*[12.321 + arange(5) * .001] * 2); show()'

test
where the offset text should be "12.320" (or at least "12.32"), not "1.232e1".

Activity

  1. added this to the milestone on May 21, 2015
  2. petehuang commented on Jan 10, 2017

    @petehuang
    Contributor

    #5785 improved the calculation of the offset text but this particular formatting issue still is up for grabs

  3. anntzer commented on Jan 10, 2017

    @anntzer
    ContributorAuthor

    @petehuang I appreciate your efforts are triaging through the list of issues, but messages such as this one only reach the (small) participants list and do not actually help bumping the issue.

  4. modified the milestones: , on Oct 3, 2017
  5. github-actions commented on Mar 13, 2023

    @github-actions

    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!

  6. added
    keepItems to be ignored by the “Stale” Github Action
    and removed
    status: inactiveMarked by the “Stale” Github Action
    on Mar 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    API: changesChanges to the public API, typically requiring deprecation.New featurekeepItems to be ignored by the “Stale” Github Action

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions