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

How to save the figure for the plotting result? #128

Open
isunix opened this issue Jun 23, 2021 · 1 comment
Open

How to save the figure for the plotting result? #128

isunix opened this issue Jun 23, 2021 · 1 comment

Comments

@isunix
Copy link

isunix commented Jun 23, 2021

How to save the figure for the plotting result?

@earthgecko
Copy link

Hi @isunix

From one user to another.
I wanted to do the same.

I have a fork with that single change that allows the plot to be save as an image:
earthgecko@895c517

This change simply adds the save_to_file parameter to plot function in the _visualization.py.

save_to_file: str, optional
    The full path and filename where to save the plot as a png image.
    Default: "".

To save a plot to file simply call plot with the save_to_file parameter set:

save_to_file = '/tmp/plot-image.png'
title = 'my adtk graph'
plot(s, anomaly=anomaly_df, anomaly_color='red', title=title, save_to_file=save_to_file)

If you want to install the fork (take care to use the appropriate pip version for your environment):

git clone https://github.com/earthgecko/adtk.git
cd adtk/
git checkout develop
pip install ./

I am only responding as there is very little activity on this project, hence I did not go to the trouble of pull requesting this change as there seemed to be little point.

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