<div dir="ltr"><div><div><div>a) no, it does not exist already<br></div>b) at first blush, yes, it would be awesome, and maybe pint might be able to help us with that.<br><br></div>however... I would caution against getting side-tracked to add such a feature at the moment. There is a lot of hidden complexities that I think has not yet been fully appreciated yet. For example, inches and points are very different from pixels, and would require diving into the transforms system. We would also open ourselves to a fair amount of confusion from users. One time, when I was teaching an intro to matplotlib, the tutorial got derailed by the very first example by a person who was confused that a figure that was specified to be 7in x 5in wasn't that size on his laptop screen!<br><br></div>Ben<br><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Aug 25, 2017 at 1:20 PM, Jody Klymak <span dir="ltr"><<a href="mailto:jklymak@uvic.ca" target="_blank">jklymak@uvic.ca</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi all,<br>
<br>
I’m trying to work out how to do the padding on my constrained_layout geometry manager (which is testable by the way if anyone wants to try to break it for me: <a href="https://github.com/matplotlib/matplotlib/pull/9082" rel="noreferrer" target="_blank">https://github.com/matplotlib/<wbr>matplotlib/pull/9082</a>). Since I do the constraints in figure-normalized co-ordinates, my pad variable is figure-normalized, which maybe makes sense for some plots, but I can easily imagine it will set some people’s OCD off if the padding is thicker in the horizotnal than the vertical because the figure is wider than it is tall.<br>
<br>
So I could do inches/cm, or pixels, or points. But I guess it’d be nice to do all four. Do we already have a units parser? I couldn’t find one. I think it’d be pretty simple: just strip the last two characters off for unit type and pass the rest as a float.<br>
<br>
1.0px (=1.0 px; i.e. strip spaces)<br>
1.0cm<br>
1.0mm<br>
1.0in<br>
1.0pt<br>
<br>
I don’t think em and en would make sense in this context because we wouldn’t know the font size, though maybe there is a sensible figure default we could use?<br>
<br>
Then calls like pad=0.01 and pad=‘5mm’ would both be acceptable.<br>
<br>
a) does this exist already?<br>
b) if not, should it?<br>
<br>
Thanks, Jody<br>
______________________________<wbr>_________________<br>
Matplotlib-devel mailing list<br>
<a href="mailto:Matplotlib-devel@python.org" target="_blank">Matplotlib-devel@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/matplotlib-devel" rel="noreferrer" target="_blank">https://mail.python.org/mailma<wbr>n/listinfo/matplotlib-devel</a><br>
</blockquote></div><br></div>