Description
Problem
While playing around with style files, I realize that for a paper it often makes sense to specify the width (set by the publisher) and ratio (determined by what we plot). Although one can of course read up and remember the figure width etc, it is quite convenient to just use a style file to determine the width and then set the ratio when creating the figure.
Proposed solution
There is https://matplotlib.org/stable/api/_as_gen/matplotlib.figure.Figure.set_figheight.html so one way is of course to create the figure using the style file and then set the height suitably.
However, some options are:
set_figratio
, basically:
set_figheight(self.get_figwidth()*ratio)
Add a figratio
keyword to Figure (and subplots and figure and ...) that takes the width, either from figsize
or add a new rcParam for figwidth. Not sure which is less confusing...
(I think one can argue that the width should be kept when modifying the ratio based on the publisher-defined argument.)
Edit: searching a bit more I found https://matplotlib.org/stable/api/figure_api.html#matplotlib.figure.figaspect which does the exact opposite to what I want. Maybe an option is to come up with a good name for a similar function that determines the size with fixed width? Although the original idea was to make it "simple".