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

DOC: Improve log scale example#29407

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
timhoffm merged 1 commit intomatplotlib:mainfromtimhoffm:doc-log-scale
Jan 8, 2025

Conversation

timhoffm
Copy link
Member

@github-actionsgithub-actionsbot added the Documentation: examplesfiles in galleries/examples labelJan 5, 2025
@timhoffmtimhoffm added this to thev3.10.0-doc milestoneJan 5, 2025
@scottshambaugh
Copy link
Contributor

scottshambaugh commentedJan 7, 2025
edited
Loading

New example image:
image

Maybe this is nitpicky, but could we have a "plain" semilogy plot next to the semilogx one? I think the base 2 labeling is super useful to include, but it takes some interpretation. It'd be nice to have a semilogy plot that you can see at a glance what's going on, and then the base 2 labeling plot could be kept but moved down.

It'd also be nice to have the minor gridlines turned on for one of these plots.

@timhoffm
Copy link
MemberAuthor

Indeed a bit nitpicky. 😄 It's a bit the question of how much can you illustrate with an example.

Theoriginal example had the base 2 on the loglog plot. I found this very unfortunate because (1) I've never seed double-log plots with different bases. That seems quite exotic. (2) to get that, one had to useset_xscale afterloglog, which is not quite instructive as you override the x log scale defined by loglog. I thought it's nice to keep thebase 2 aspect somewhere, and the semilogy was the one where it was least confusing. But maybe it's better to leave the base 2 out here?

I also think that adding minor grids here would be too cluttered.

If we want to have all the aspects in, we probably need to structure the example into subsections:

  1. semilogx, semilogy, loglog
  2. base 2
  3. minor grids
  4. log with errorbars that get negative

@scottshambaugh
Copy link
Contributor

However you want to slice it! I think it's definitely an improvement over what's there currently.

@timhoffmtimhoffmforce-pushed thedoc-log-scale branch 2 times, most recently from6adabd3 to2c399beCompareJanuary 8, 2025 21:55
- Removehttps://matplotlib.org/stable/gallery/scales/semilogx_demo.html  It is redundant to the other log scale example.- Explain that semilogx/semilogy/loglog are shortcuts.- Tune data/visualization
@timhoffm
Copy link
MemberAuthor

@scottshambaugh I've reworked the example. There's now one plot with semilogx/semilogy/loglog, also containing minor grids, as that makes it more obvious which directions are logarithmic.

I've added separate examplesbase=2 and handling of non-positive values.

@scottshambaugh
Copy link
Contributor

I think this looks great, breaking it up into sections was a good move and the exposition helps a lot to interpret what's going on. Good to merge unless you want another reviewer!

timhoffm reacted with hooray emoji

@timhoffmtimhoffm merged commit9a834ad intomatplotlib:mainJan 8, 2025
22 checks passed
@timhoffmtimhoffm deleted the doc-log-scale branchJanuary 8, 2025 22:41
meeseeksmachine pushed a commit to meeseeksmachine/matplotlib that referenced this pull requestJan 8, 2025
meeseeksmachine pushed a commit to meeseeksmachine/matplotlib that referenced this pull requestJan 8, 2025
timhoffm added a commit that referenced this pull requestJan 8, 2025
…407-on-v3.10.xBackport PR#29407 on branch v3.10.x (DOC: Improve log scale example)
timhoffm added a commit that referenced this pull requestJan 8, 2025
…407-on-v3.10.0-docBackport PR#29407 on branch v3.10.0-doc (DOC: Improve log scale example)
@ksundenksunden mentioned this pull requestMar 3, 2025
5 tasks
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@scottshambaughscottshambaughscottshambaugh approved these changes

Assignees
No one assigned
Labels
Documentation: examplesfiles in galleries/examples
Projects
None yet
Milestone
v3.10-doc
Development

Successfully merging this pull request may close these issues.

2 participants
@timhoffm@scottshambaugh

[8]ページ先頭

©2009-2025 Movatter.jp