I agree that we have to remain in inches internally. Non-metric units are pretty ingrained in the printing world (not just in matplotlib) -- Postscript, for example, always does page sizes in inches, even if you're using a "metric" page size like A4. The current definition of a point as 1/72 of a modern inch is also fairly standard worldwide. Even printers in France, for example, are spec'd in points par pouce (ppp), which is exactly equivalent to dots per inch (dpi).
However, that's just an implementation detail we have to stick with. Matplotlib has Figure.get/set_size_inches now. What's to stop us from adding get/set_size_cm, and doing the conversion right there? There might be some rounding error, but I don't think it matters in this particular case. We would probably also want to add a "figsize_cm" kwarg to the Figure constructor (which would be mutually exclusive to "figsize"). What do you think? Cheers, Mike Eric Firing wrote: > Coincidentally, I was just thinking about this a couple days ago, when > reviewing the units kwarg of the colorbar. I decided then that adding a > cm option just wasn't worth even the small amount of extra code; inches > are fairly deeply embedded, as witness the standard "dpi" way of > specifying pixel size on output devices. > > I do understand the rationale; many of us in the US would have preferred > if the US had continued with the transition to metric units instead of > backing off. For mpl right now, however, I don't think it is worthwhile > to add the extra complexity, no matter how small it may seem, of a > general cm option, or a great number of docstring additions saying > "There are 2.54 cm per inch." > > Somewhere along the line, it may make sense to support the metric system > better in mpl. > > Eric > > Olivier Verdier wrote: >> Hi! >> >> >> I really enjoy using matplotlib but something is strange with the units >> used for the figure size. It seems that it must be in inches? (I'm >> thinking of the figure.figsize value in matplotlibrc, for instance). >> >> >> Of course if one knows how long an inch is (apparently 2.5 cm) it's not >> difficult to convert a value in mm or cm to inches but most people >> around here (Europe) have never used inches in their life. >> >> >> I believe that centimetres (or millimetres) should be the default unit >> for all lengths because it is familiar to everybody... as far as I know. >> >> >> Then you might also allow the customary local units of various >> countries. If you really want to only use inches then i think that you >> should specify that an inch corresponds to 2.5 cm wherever a value in >> inches is needed. Most users of matplotlib have no clue as to how long >> an inch is. >> >> >> I'd be willing to help on that matter if you all agree that such a >> change would be a good idea. >> >> >> Thanks!! >> >> >> == Olivier >> >> >> ------------------------------------------------------------------------ >> >> ------------------------------------------------------------------------- >> This SF.net email is sponsored by: Splunk Inc. >> Still grepping through log files to find problems? Stop. >> Now Search log events and configuration files using AJAX and a browser. >> Download your FREE copy of Splunk now >> http://get.splunk.com/ >> >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> Matplotlib-devel mailing list >> Matplotlib-devel@lists.sourceforge.net >> https://lists.sourceforge.net/lists/listinfo/matplotlib-devel > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. > Still grepping through log files to find problems? Stop. > Now Search log events and configuration files using AJAX and a browser. > Download your FREE copy of Splunk now >> http://get.splunk.com/ > _______________________________________________ > Matplotlib-devel mailing list > Matplotlib-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/matplotlib-devel -- Michael Droettboom Science Software Branch Operations and Engineering Division Space Telescope Science Institute Operated by AURA for NASA ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ _______________________________________________ Matplotlib-devel mailing list Matplotlib-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-devel