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
The print_foo() methods of all backends (that implement saving to a
given format -- print_svg saves to svg, etc.) all have an undocumented
`dryrun` parameter that effectively means "don't actually do the
drawing; just set the _cachedRenderer attribute on the figure" with the
intent of using that renderer object to determine the figure tight bbox
for saving with bbox_inches="tight".
- This behavior is not actually implemented for the pdf backend, so
saving to pdf with bbox_inches="tight" will currently fully walk the
artist tree twice.
- This is a parameter that needs to be reimplemented again and again for
all third-party backends (cough cough, mplcairo).
Instead, we can extract that renderer object by fiddling with
Figure.draw (see implementation of _get_renderer), which may not be the
most elegant, but avoids having to reimplement the same functionality
across each backend.
This patch also found that Table's window_extent is incorrect until a
draw() is performed. Fix that problem by correctly setting the table's
text positions in get_window_extent().
0 commit comments