You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To calculate accurate coordinate mappings for matplotlib (& plotnine) plots
in display coordinates, the figure should know the location of it's subplots.
The location determined by the subplot parameters (subplot_params) and they
come from one or more of these sources, listed from lowest to highest priority:
1. rcParams
2. plt.subplots(..., gridspec_kw={..., **subplot_params})
3. fig.subplot_adjust(**subplot_params)
4. layout engine
The layout engine has the last say as it dynamically calculates subplot_params
and calls fig.subplot_adjust() to set them.
There are two things to consider:
1. Only layout engines that are "adjust_compatible" calculate subplot_params
2. Matplotlib runs the layout engine only when drawing the figure
This PR ensures that there is an "adjust_compatible" layout engine and the plot
is drawn/saved before the coordinate mappings are calculated.
closeshas2k1/plotnine#738
0 commit comments