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 symlog scale now shows negative labels.#7337

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

Merged
efiring merged 3 commits intomatplotlib:masterfromNelleV:7211_symlog
Oct 29, 2016
Merged

FIX symlog scale now shows negative labels.#7337

efiring merged 3 commits intomatplotlib:masterfromNelleV:7211_symlog
Oct 29, 2016

Conversation

NelleV
Copy link
Member

@NelleVNelleV commentedOct 24, 2016
edited
Loading

The formatter returned empty strings for negative value.

closes#7146

@NelleV
Copy link
MemberAuthor

For information, I am uncovering major problems in the ticker module.

The formatter returned empty strings for negative value.closes#7146
@NelleVNelleV changed the title[WIP] FIX symlog scale now shows negative labels.[MRG] FIX symlog scale now shows negative labels.Oct 24, 2016
@NelleVNelleV added this to the2.0 (style change major release) milestoneOct 24, 2016
@NelleVNelleV added status: needs review Release criticalFor bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions. labelsOct 24, 2016
elif x > 10000:
s = '%1.0e' %x
s = '%1.0e' %abs(x)
Copy link
Member

Choose a reason for hiding this comment

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

Something is still wrong--this doesn't make sense. It looks like the solution is to remove all of theseabs calls, and instead setx = abs(x) right after saving the sign of x, a few lines above.

Copy link
Member

Choose a reason for hiding this comment

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

Also, if the LogFormatter is going to handle negative values, this should be explained in the docstring.

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

The LogFormatter is used with the SymmetricalLogLocator so it should (and probably always has) deal with negative value. But the LogLocator doesn't deal with negative values.

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

I'll fix the abs stuff. Another solution is not to deal with the sign as it is done in the other formatter (or remove the explicit dealing with sign as it is done right now, I am not sure why)
Honestly, I think this whole part should be refactored and rewritten. I just wanted a quick and easy fix in this PR, as this is a critical bug for 2.0 and don't think we should refactor all this before the release.

Copy link
Member

Choose a reason for hiding this comment

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

I think that dealing with the sign separately is a simplification; all the logic can work with conditions based onx>0, as appropriate for logs. The generalization to make it usable for symlog is then just a matter of stripping off the sign at the start and putting it back at the end.

@tacaswelltacaswell changed the title[MRG] FIX symlog scale now shows negative labels.[MRG+1] FIX symlog scale now shows negative labels.Oct 26, 2016
@tacaswell
Copy link
Member

@efiring Can you re-review?

@NelleV
Copy link
MemberAuthor

Note: the patch for#7202 relies on this fix.

@efiringefiring changed the title[MRG+1] FIX symlog scale now shows negative labels.FIX symlog scale now shows negative labels.Oct 29, 2016
@efiringefiring merged commit1f38ea6 intomatplotlib:masterOct 29, 2016
efiring added a commit that referenced this pull requestOct 29, 2016
FIX symlog scale now shows negative labels.Conflicts:lib/matplotlib/tests/test_ticker.py
@efiring
Copy link
Member

Back ported to v2.x ase2de966.

@NelleV
Copy link
MemberAuthor

Thanks@efiring for merging!

@NelleVNelleV deleted the 7211_symlog branchOctober 30, 2016 17:09
bcongdon pushed a commit to bcongdon/matplotlib that referenced this pull requestNov 8, 2016
FIX symlog scale now shows negative labels.Conflicts:lib/matplotlib/tests/test_ticker.py
bcongdon pushed a commit to bcongdon/matplotlib that referenced this pull requestNov 8, 2016
FIX symlog scale now shows negative labels.Conflicts:lib/matplotlib/tests/test_ticker.py
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@efiringefiringefiring approved these changes

Assignees
No one assigned
Labels
Release criticalFor bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions.
Projects
None yet
Milestone
v2.0.0
Development

Successfully merging this pull request may close these issues.

symlog scale no longer shows labels on the negative side
4 participants
@NelleV@tacaswell@efiring@QuLogic

[8]ページ先頭

©2009-2025 Movatter.jp