Repository navigation
Add example for specifying figure size in different units - #18360
Conversation
jklymak
left a comment
There was a problem hiding this comment.
This looks helpful. A few suggestions?
|
|
||
| matplotlib.pyplot.figure | ||
| matplotlib.pyplot.subplots | ||
| matplotlib.pyplot.subplot_mosaic |
There was a problem hiding this comment.
This is to trigger the back links which I think is useful here (as these are the entry points where we want people to use to set the figure size)?
| # 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.
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 to https://en.wikipedia.org/wiki/Inch? and/or more decimal places? Or at least say its exact?
There was a problem hiding this comment.
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.
OK, but doing 1/2.5400 wouldn't hurt?
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.