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

Appearance settings

DOC: Explain parameters linthresh and linscale of symlog scale #29347

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

Merged
merged 3 commits into from
Dec 21, 2024

Conversation

timhoffm
Copy link
Member

Closes #29335 via addressing #29335 (comment).

Copy link
Contributor

@greglucas greglucas left a comment

Choose a reason for hiding this comment

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

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.

galleries/examples/scales/symlog_demo.py Outdated Show resolved Hide resolved
Comment on lines +80 to +81
# data points are in the linear region. As a rule of thumb,
# :math:`linthresh \approx \mathrm{min} |x|`.
Copy link
Contributor

Choose a reason for hiding this comment

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

Where does this rule of thumb come from? I feel like this might be very data dependent and perhaps we shouldn't suggest anything 🤷

Copy link
Member Author

@timhoffm timhoffm Dec 20, 2024

Choose a reason for hiding this comment

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

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 <greg.m.lucas@gmail.com>
galleries/examples/scales/symlog_demo.py Outdated Show resolved Hide resolved
galleries/examples/scales/symlog_demo.py Outdated Show resolved Hide resolved
@timhoffm timhoffm merged commit 109f857 into matplotlib:main Dec 21, 2024
20 of 22 checks passed
@timhoffm timhoffm deleted the symlog branch December 21, 2024 07:03
meeseeksmachine pushed a commit to meeseeksmachine/matplotlib that referenced this pull request Dec 21, 2024
meeseeksmachine pushed a commit to meeseeksmachine/matplotlib that referenced this pull request Dec 21, 2024
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)
@ksunden ksunden mentioned this pull request Mar 3, 2025
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation: examples files in galleries/examples
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[ENH]: Indicating change of scale for symlog
2 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.