LSYS / forestplot

A Python package to make publication-ready but customizable coefficient plots.
http://forestplot.rtfd.io
MIT License
110 stars 10 forks source link

Save SVG version of the forest plot #72

Closed Mihiretukebede closed 1 year ago

Mihiretukebede commented 1 year ago

Thanks for this great library! I prefer to write my plots in SVG since it has a much better resolution than PNG or JPEG formats. I tried to use plt.savefig() function but it writes an empty file. Is it not possible to save the plot outputs in svg? It would be great if this feature is added.

LSYS commented 1 year ago

hi @Mihiretukebede, thanks for giving this package a go. Do you have a reproducible example? I seem to have no issues saving in SVG.

Perhaps see also issue #38. Specifically https://github.com/LSYS/forestplot/issues/38#issuecomment-1366706791

Mihiretukebede commented 1 year ago

I tried saving using the following but it didn't work. plt.savefig("plot.svg")

LSYS commented 1 year ago

@Mihiretukebede try this

plt.savefig("plot.svg", bbox_inches="tight")
Mihiretukebede commented 1 year ago

plt.savefig("Python_Forest_plot.svg", bbox_inches="tight") Unfortunately, this results in an error. AttributeError: 'AxesSubplot' object has no attribute 'savefig'

LSYS commented 1 year ago

@Mihiretukebede can you provide more context?

or see this: https://stackoverflow.com/a/33617056

github-actions[bot] commented 1 year ago

This issue is stale because it has been open for 30 days with no activity.

github-actions[bot] commented 1 year ago

This issue was closed because it has been inactive.