Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
Add example for specifying figure size in different units#18360
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
Uh oh!
There was an error while loading.Please reload this page.
Conversation
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.
This looks helpful. A few suggestions?
Uh oh!
There was an error while loading.Please reload this page.
matplotlib.pyplot.figure | ||
matplotlib.pyplot.subplots | ||
matplotlib.pyplot.subplot_mosaic |
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.
Not used?
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.
This is to trigger theback links which I think is useful here (as these are the entry points where we want people to use to set the figure size)?
Uh oh!
There was an error while loading.Please reload this page.
# conversion almost look like appending a unit to the number, which is nicely | ||
# readable. | ||
# | ||
cm = 1/2.54 # cm in inches |
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 was 90% sure this was exact, but had to look it up to be 100% sure. You may want to indicate that with a link tohttps://en.wikipedia.org/wiki/Inch? and/or more decimal places? Or at least say its exact?
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.
IMHO that'd be overly cautious. One should assume that code/logic is correct unless explicitly indicated as an approximation. I'd really feel awkward adding something like "Look, what we're doing is really correct. Here is the proof".
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.
OK, but doing1/2.5400
wouldn't hurt?
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
PR Summary
This explains and illustrates best practices for working with figure sizes in units differing from the default inches.
This addresses the user needs of#12402 as good as possible without introducing new API.