Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

save plots directly with path instead of just displaying #43

Open
mcon157 opened this issue May 15, 2024 · 1 comment
Open

save plots directly with path instead of just displaying #43

mcon157 opened this issue May 15, 2024 · 1 comment

Comments

@mcon157
Copy link

mcon157 commented May 15, 2024

Hello, I was just wondering if there was any method of saving png's directly with a given path and filename instead of plot.show(). Thanks

@shimwell
Copy link
Member

Hi @mcon157

Yes you can do this with .savefig as the return object is a matplotlib object

See this example

plt = plot_gamma_emission(material=my_material, label_top=3)
plt.xscale("log") # modify axis from default settings
plt.savefig("gamma_spec.png")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants