Skip to content

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

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
wants to merge 1 commit into from

Conversation

zblz
Copy link
Member

@zblz zblz commented Jul 26, 2016

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?

labels

@QuLogic
Copy link
Member

QuLogic commented Jul 26, 2016

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

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

This is probably the same root cause as #6847

This was referenced Aug 1, 2016
@zblz
Copy link
Member Author

zblz commented Aug 4, 2016

@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
Copy link
Member

QuLogic commented Aug 4, 2016

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

@tacaswell
Copy link
Member

@zblz This needs a rebase

@zblz
Copy link
Member Author

zblz commented Sep 2, 2016

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
Copy link
Member

efiring commented Nov 25, 2016

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
Copy link
Member

efiring commented Nov 25, 2016

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

@QuLogic
Copy link
Member

QuLogic commented Dec 7, 2016

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

@QuLogic QuLogic modified the milestones: 2.1 (next point release), 2.0 (style change major release) Dec 7, 2016
@dstansby
Copy link
Member

dstansby commented Feb 6, 2017

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

@dstansby dstansby self-assigned this Feb 6, 2017
@zblz
Copy link
Member Author

zblz commented Feb 7, 2017

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

@zblz
Copy link
Member Author

zblz commented Feb 7, 2017

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.

Copy link
Member

@dstansby dstansby left a comment

Choose a reason for hiding this comment

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

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

@NelleV
Copy link
Member

NelleV commented Mar 18, 2017

Closing in favor of #8322

@NelleV NelleV closed this Mar 18, 2017
@dstansby dstansby removed their assignment Apr 10, 2017
@zblz zblz deleted the min-exponent branch March 18, 2019 16:41
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