Open gangemi opened 1 year ago
For SVG and PNG exports, different matplotlib FigureCanvas
classes are used (FigureCanvasSVG
for svgs and FigureCanvasAgg
if not), but you can pass whatever you need with the canvas_cls=
argument to plot.save()
, in addition to extra kwargs for the matplotlib's .print_figure()
method.
Maybe the defaults are different... or maybe it's a transparency thing? (the frameon
attribute of the Figure
is set as False, so in PNGs the outside space is transparent.
If you need to set a colored background for the PNG export, you can do this:
# this ensures a figure is created
ax = chart.plot()
# this enables the frame for the background
ax.get_figure().set_frameon(True)
# save with custom facecolor
chart.save("test1-chart.png", facecolor="#FFFF00")
If that's not the problem, could you provide more detailed info to try to reproduce your issue?
chart.save("test1-chart.svg") has axis, some white space outside of chart. chart.save("test1-chart.png") has no axis, png ends at boundaries of chart.