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: Flip the imshow plot types example to match the other examples#28252

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

Conversation

scottshambaugh
Copy link
Contributor

@scottshambaughscottshambaugh commentedMay 17, 2024
edited
Loading

PR summary

Flips the imshow plot types example to put the origin at the lower left instead of the default upper left. This allows for direct comparison with the 6 other examples that use the same data.

Before:
image

After:
image

PR checklist

@github-actionsgithub-actionsbot added the Documentation: plot typesfiles in galleries/plot_types labelMay 17, 2024
@story645
Copy link
Member

am back and forth b/c agree that direct comparison is better suited for choosing an appropriate function but a bit unsure about this b/c ideally the plot types gallery would use as many defaults as possible/show the default behavior

@scottshambaughscottshambaugh added this to thev3.9.1 milestoneMay 17, 2024
@scottshambaugh
Copy link
ContributorAuthor

We do put a few non-default kwargs in other examples, like an alpha value. Just added the "after" screenshot to the top level description, does the 1:1 comparison look worthwhile after seeing it?

@story645
Copy link
Member

We do put a few non-default kwargs in other examples, like an alpha value.

Yeah styling, not data reading :/ But yeah the flip option of inverting the first array so the images match is probably more confusing.

Copy link
Member

@story645story645 left a comment

Choose a reason for hiding this comment

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

Thinking about this more, on net, better for the functions to be comparable. Also honestly might be good to expose the origin keyword so it doesn't trip folks up in precisely this data arrays read are arranged differently from images way.

scottshambaugh reacted with thumbs up emoji
@story645story645 merged commitf0f204e intomatplotlib:mainMay 17, 2024
19 checks passed
meeseeksmachine pushed a commit to meeseeksmachine/matplotlib that referenced this pull requestMay 17, 2024
timhoffm added a commit that referenced this pull requestMay 17, 2024
…252-on-v3.9.xBackport PR#28252 on branch v3.9.x (DOC: Flip the imshow plot types example to match the other examples)
@jklymak
Copy link
Member

I have exactly the opposite take. Folks will use imshow, their plots will be upside down, and they will wonder why that is when this page has the plots all the same. I doubt most people click through to the example to see the use of the origin keyword. I think this change will cause more confusion than not.

@scottshambaugh
Copy link
ContributorAuthor

scottshambaugh commentedMay 18, 2024
edited
Loading

So my thought with making this change was:

  • I think that it's easy to get confused by theimshow coordinates, and showing that kwarg in more examples helps bring attention to the flag.
  • Having looked at that page maybe a dozen times, I don't think it's obvious that the plotis upside down - it just looks like blobs. I had no idea it was the same as the other examples until I was looking at the sources for another update. I think having it match the rest is a better way to key in on what the differences in the different methods are.
  • My impression is thatimshow is really meant to be used withimread/PIL.Image.open rather than with generated data. If we're going to further improve the example, I'd propose we use an actual image for the example rather than a blobby raster field.
story645 reacted with thumbs up emoji

@jklymak
Copy link
Member

To me, the goal is to show what the same data looks like when plotted with different methods. I think that is best served using the defaults.

@story645
Copy link
Member

To me, the goal is to show what the same data looks like when plotted with different methods

That's why I came around to thinking that showing the use of the origin keyword is helpful. Like the first time I plotted data using imshow it was upside down & I was so confused - and manually flipped it using something like data[::-1] b/c I didn't know about the keyword.

@timhoffm
Copy link
Member

Theplot types page is primarily to give an overview of the different kinds of visualizations, not teach any of their specifics. In that sense, it doesn't matter too much whether the data/result image is flipped or not. But generally, I'd go with using the functions mostly as is and not doing extra things to hide any specific behavior. So, I'm -0.5 on this, but don't find it important enough to go into a lengthy discussion.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@story645story645story645 approved these changes

Assignees
No one assigned
Labels
Documentation: plot typesfiles in galleries/plot_types
Projects
None yet
Milestone
v3.9.1
Development

Successfully merging this pull request may close these issues.

4 participants
@scottshambaugh@story645@jklymak@timhoffm

[8]ページ先頭

©2009-2025 Movatter.jp