FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Use scalars below a certain exponent in labes of log-scales axis by zblz · Pull Request #6834 · matplotlib/matplotlib · GitHub

Repository navigation

Use scalars below a certain exponent in labes of log-scales axis - #6834

Closed
zblz wants to merge 1 commit into
matplotlib:masterfrom
zblz:min-exponent
Closed

zblz wants to merge 1 commit into
matplotlib:masterfrom
zblz:min-exponent

Conversation

zblz commented Jul 26, 2016

Copy link
Copy Markdown
Member

This is a restart of #4730 with the added functionality of the configuration through rcParams. There is a new rcParam called axes.formatter.min_exponent that sets the minimum exponent that will be formatted as 10^{x}. I have currently set the default to 0 to retain current behaviour of formatting everything as 10^{x}, including 10^{0}. A setting of 3 would reproduce the behaviour of @astrofrog's implementation in #4730.

The remaining problem is the baseline for labels on the x axis. Because of the lack of exponent, they are aligned quite a bit higher that the rest of the labels, see below. @mdboom: Any idea on how to fix this? Is there a way to pass a minimum height for the text box from the formatter?

QuLogic commented Jul 26, 2016

Copy link
Copy Markdown
Member

This one really makes clear how the vertical alignment is wrong for text with superscripts as I've been saying on gitter.

tacaswell added this to the 2.0 (style change major release) milestone Jul 28, 2016

Copy link
Copy Markdown
Member

This is probably the same root cause as #6847

This was referenced Aug 1, 2016

zblz commented Aug 4, 2016

Copy link
Copy Markdown
Member Author

@mdboom: Your fix for the x-axis aligment does indeed fix the issue here but also changes the aligmnent of labels in many other test images, and some of them look worse. Maybe we should review that in a different PR?

QuLogic commented Aug 4, 2016 •
edited
Loading

Copy link
Copy Markdown
Member

I think regular text is now one pixel too low (in addition to exponents being too low already):

Copy link
Copy Markdown
Member

@zblz This needs a rebase

zblz commented Sep 2, 2016

Copy link
Copy Markdown
Member Author

The alignment fix by @mdboom introduces changes in many many labels on the test images. I'm not sure about many of them and think this should be discussed in a separate PR. I propose to split the alignment fix into its own PR so we can discuss it independently.

efiring commented Nov 25, 2016

Copy link
Copy Markdown
Member

This is a reasonable proposal provide an option that some will like, but I am not comfortable with the extra complexity it adds to handle the positioning. It sounds like a better way to to do that is via positioning labels by their baseline, as suggested somewhere that I can't find right now. I'm open to arguments either way.
I'm close to changing the milestone to 2.1, since this is really a new feature rather than a style change. As an intermediate step, I will use a label to make it clear this is not a blocker.

efiring commented Nov 25, 2016

Copy link
Copy Markdown
Member

See also #2015, #4115. It would certainly be nice to get all of this resolved clearly and cleanly.

QuLogic commented Dec 7, 2016

Copy link
Copy Markdown
Member

This needs a rebase and a review, so I don't think it's going into 2.0.

QuLogic modified the milestones: 2.1 (next point release), 2.0 (style change major release) Dec 7, 2016

dstansby commented Feb 6, 2017

Copy link
Copy Markdown
Member

This looks like a neat feature! @zblz could you rebase it on to the current master branch?

dstansby self-assigned this Feb 6, 2017

zblz commented Feb 7, 2017

Copy link
Copy Markdown
Member Author

@dstansby - This is now rebased on master with tests updated for py.test.

zblz commented Feb 7, 2017

Copy link
Copy Markdown
Member Author

Note that I have also removed the baseline fixing commit added by @mdboom. As mentioned above, it introduces a lot of changes in baseline images that I think should be discussed in a separate PR or issue such as #4115.

dstansby left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Looks good to me, just needs a what's new entry.

NelleV commented Mar 18, 2017

Copy link
Copy Markdown
Member

Closing in favor of #8322

NelleV closed this Mar 18, 2017
dstansby removed their assignment Apr 10, 2017
zblz deleted the min-exponent branch March 18, 2019 16:41
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants


Back | FazBrowse Home | New Git URL