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
This is a great default.
But sometimes you want to have more control over the bbox (especially when working with extreme aspect ratios, when "tight" produces totally different figsizes than what you requested).
Also, if in your rcparams, savefig.bbox is set to "standard" (the default) and not "tight", then your saved figures will differ from the displayed figures, which is confusing.
So, it would be nice if this hardcoded setting was somehow configureable in PythonPlot.
The text was updated successfully, but these errors were encountered:
This is what I currently use to override PythonPlot's display
(ignoring other formats besides PNG, and foregoing the _showable(m, f) check):
using PythonPlot: Figure, matplotlib as mpl
functionset_bbox(bbox ="standard")
if bbox ∈ ("standard", "tight") # The dict-like `mpl.rcParams` object errors if not
mpl.rcParams["savefig.bbox"] = bbox
end# From PythonPlot.jl:@eval Main function Base.show(io::IO, m::MIME"image/png", f::Figure)
if$(bbox =="standard") # Can't pass that here.
f.canvas.print_figure(io, format="png")
else
f.canvas.print_figure(io, format="png", bbox_inches=$bbox)
endendend
All figures are displayed with matplotlib's auto-selection of the crop:
PythonPlot.jl/src/PythonPlot.jl
Line 86 in fe588f4
This is a great default.
But sometimes you want to have more control over the bbox (especially when working with extreme aspect ratios, when
"tight"
produces totally different figsizes than what you requested).Also, if in your rcparams,
savefig.bbox
is set to"standard"
(the default) and not"tight"
, then your saved figures will differ from the displayed figures, which is confusing.So, it would be nice if this hardcoded setting was somehow configureable in PythonPlot.
The text was updated successfully, but these errors were encountered: