DOC: Explain parameters linthresh and linscale of symlog scale#29347
Merged
timhoffm merged 3 commits intomatplotlib:mainfrom Dec 21, 2024
Merged
DOC: Explain parameters linthresh and linscale of symlog scale#29347timhoffm merged 3 commits intomatplotlib:mainfrom
timhoffm merged 3 commits intomatplotlib:mainfrom
Conversation
5a4f30a to
7311008
Compare
greglucas
approved these changes
Dec 20, 2024
Contributor
greglucas
left a comment
There was a problem hiding this comment.
This is definitely an improvement 👍 , approving it so you can self-merge when you want. I have two minor comments that you can take or leave.
Comment on lines
+80
to
+81
| # data points are in the linear region. As a rule of thumb, | ||
| # :math:`linthresh \approx \mathrm{min} |x|`. |
Contributor
There was a problem hiding this comment.
Where does this rule of thumb come from? I feel like this might be very data dependent and perhaps we shouldn't suggest anything 🤷
Member
Author
There was a problem hiding this comment.
This comes from the two arguments
- linthresh should not be much larger than your min value, as that would push too many points into the linear region. But the linear region should not hold much data: 1. The symlog scale was chosen because of it's log scaling. If most interesting stuff is in the linear range, one could have remained on a linear scale. 2. Due to the different scaling, data relations in the lin. vs. Log regimes are not comparable. For clarity there shouldn't be much going on in the linear regime.
- linthresh should not be much smaller than your min value, as that would mean you have empty decades between linthresh and your data - effectively pushing your data to the borders of the plot and leaving a lot of unused space in the center.
Unfortunately, one has to adapt linthresh depending on the data to get a decent looking plot. When I looked into this first I had no idea what value to choose. While you can create datasets that needs special different tuning, I feel the approximate rule of thumb will generally be a good starting point..
Co-authored-by: Greg Lucas <[email protected]>
timhoffm
commented
Dec 21, 2024
meeseeksmachine
pushed a commit
to meeseeksmachine/matplotlib
that referenced
this pull request
Dec 21, 2024
…inscale of symlog scale
meeseeksmachine
pushed a commit
to meeseeksmachine/matplotlib
that referenced
this pull request
Dec 21, 2024
…inscale of symlog scale
QuLogic
added a commit
that referenced
this pull request
Dec 21, 2024
…347-on-v3.10.x Backport PR #29347 on branch v3.10.x (DOC: Explain parameters linthresh and linscale of symlog scale)
QuLogic
added a commit
that referenced
this pull request
Dec 21, 2024
…347-on-v3.10.0-doc Backport PR #29347 on branch v3.10.0-doc (DOC: Explain parameters linthresh and linscale of symlog scale)
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
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.
Closes #29335 via addressing #29335 (comment).