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

add pyplot savefig() #25

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

add pyplot savefig() #25

wants to merge 1 commit into from

Conversation

holmbuar
Copy link

@holmbuar holmbuar commented Sep 24, 2019

I am using Ripser.py alongside a Docker container running all the python stuff. This makes plotting tricky if at all possible. The workaround is simply to use pyplot.savefig() and save the plots as files.

This pull request is a naive and humble attempt to enable figure saving functionality to Ripser.py. Suggestions, edits and/ or corrections are welcome.

@codecov-io
Copy link

codecov-io commented Sep 24, 2019

Codecov Report

Merging #25 into master will decrease coverage by 0.3%.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #25      +/-   ##
==========================================
- Coverage   80.03%   79.73%   -0.31%     
==========================================
  Files          10       10              
  Lines         531      533       +2     
  Branches      105      106       +1     
==========================================
  Hits          425      425              
- Misses         78       79       +1     
- Partials       28       29       +1
Impacted Files Coverage Δ
persim/visuals.py 57.94% <0%> (-1.11%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f8eb567...60c606e. Read the comment docs.

Copy link
Member

@sauln sauln left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry it took me so long to circle back about this. Address the couple of comments regarding the arguments and I'll merge asap.

@@ -175,6 +178,9 @@ def plot_diagrams(
if show is True:
plt.show()

if save is True:
plt.savefig(figures_directory + filename)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you change it to only accept one argument, filename please.

ax=None,
save=False,
figures_directory=None,
filename=None
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you need both save and filename? How about if filename is not None, then save to the filename

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

Successfully merging this pull request may close these issues.

3 participants