-
-
Notifications
You must be signed in to change notification settings - Fork 8.5k
Improve symlog axis ticks #27310
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
Open
schtandard
wants to merge
49
commits into
matplotlib:main
Choose a base branch
from
schtandard:symlog_ticks
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Improve symlog axis ticks #27310
Changes from all commits
Commits
Show all changes
49 commits
Select commit
Hold shift + click to select a range
8217fe0
Do not discard sign of tick value
schtandard 27f3482
Improve some log ticker details
schtandard 6a28eff
Improve symlog ticker
schtandard 907a5eb
Update symlog tests
schtandard 2df2b64
Rename new rcParam
schtandard 97063d5
Streamline subtick determination
schtandard e9be32d
Fix missing stub parameter
schtandard 42772e5
Remove legacy behavior
schtandard 12a2b26
Add new parameters backward-compatibly
schtandard aa4e895
Note API changes
schtandard d959af3
Fix rst syntax
schtandard b39a71c
Rename _symlog to _is_symlog
schtandard 67c5ef7
Instantiate _symlogutil in init()
schtandard 5bb8291
Relay changed base value to _symlogutil
schtandard 1b7b6ee
Add versioning directives
schtandard 1a8bd23
Create _symlogutil before using set_base()
schtandard 605765b
Delay _symlogutil instantiation
schtandard 6fdc786
Use minor ticks in symlog test
schtandard f51ea20
Update test output
schtandard f4f2108
Simplify _SymmetricalLogUtil.init()
schtandard ccaf6ed
Make _symlogutil instantiation more explicit
schtandard ebb6a30
Simplify calculation syntax
schtandard 7cb1be8
Remove docstring remnants
schtandard b2b2dd9
Explain normalized position and decade number
schtandard ce3151f
Streamline firstdec usage
schtandard 18896bd
Rename variables consistently
schtandard a8957ee
Update stub patterns
schtandard 8353830
Remove spurious stub default values
schtandard 2a13651
Choose clearer method names
schtandard 35621af
Motivate threshold for acceptable tick positions
schtandard 420e057
Describe function of helper coordinates first
schtandard 03fcaa2
Include ASCII drawing relating coordinate systems
schtandard 5615500
Instantiate symlog formatter with all parameters
schtandard 89985c3
Convert _SymmetricalLogUtil to a mixin
schtandard 1b38253
Make mixin methods private
schtandard 9962282
Document where mixin is used
schtandard b4547c8
Avoid spurious check
schtandard 9ad864b
Use individual parameters rather than transform
schtandard c2f1de2
Simplify _is_symlog test
schtandard 69a28b8
Fix changed attribute name
schtandard f1572f8
Register missing _SymmetricalLogMixin warning
schtandard ec32280
Add tests for the mixin methods
schtandard 0e89165
Fix rst markup and typos
schtandard 97488ea
Improve docstring phrasing
schtandard d243c3f
Document all possible values of subs
schtandard 6459a7e
Use mpl20 style in modified test
schtandard ac60281
Optimize modified png images using oxipng
schtandard b7217a3
Clarify release note
schtandard 81749a8
Add example plot
schtandard File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| Improved ``symlog`` tick placement | ||
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
|
||
| The tick placement for ``symlog`` axes has been improved. It now also supports | ||
| minor ticks and `.SymmetricalLogScale` uses ``subs='auto'`` (minor ticks if | ||
| appropriate) by default rather than ``subs=None`` (no minor ticks). |
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| Improved tick placement for ``symlog`` axes | ||
| ------------------------------------------- | ||
|
|
||
| The placement of ticks for ``symlog`` axes has been improved. Ticks are now | ||
| placed identically to ``log`` axes in the logarithmic part with a reasonable | ||
| extension of this behavior to the linear part of the axis. Axes with too few | ||
| ticks or spurious ticks are avoided by the new implementation. | ||
|
|
||
| .. plot:: | ||
| :include-source: true | ||
|
|
||
| fig, axs = plt.subplots(1, 2) | ||
| x = np.arange(201) | ||
|
|
||
| for ax, (ymin, ymax) in zip(axs, [(-30, 200), (0.6, 6)]): | ||
| y = np.linspace(ymin, ymax, x.size) | ||
| ax.set_yscale('symlog') | ||
| ax.grid(which='major') | ||
| ax.plot(x, y, '.') | ||
|
|
||
| fig.tight_layout() | ||
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
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
Binary file not shown.
Binary file modified
BIN
-102 Bytes
(98%)
lib/matplotlib/tests/baseline_images/test_axes/symlog2.pdf
Binary file not shown.
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
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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a sample plot for the what's new note?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I added one. Have a look if you think it does a good job.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since the text says ticks will be placed identically to
logaxes, can you rearrange it a bit to show that? Currently, the limits are so different that that isn't so clear.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if I understand you correctly. Do you mean adding
logplots alongside thesymlogplots showing the logarithmic part of the respective axis range (i.e. everything above 2)? Or do you mean add asymlogaxis containing only the logarithmic range and put alogaxis with the same range next to it? Or something else?