problem on save fig in star.peakbag.plot_echelle
Closed this issue · 10 comments
It seems that there is something missing when I try to save the plot of the echelon diagram in the following command:
star.peakbag.plot_echelle(pg).savefig('file.png')
The code says:
/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/lightkurve/seismology/core.py:170: LightkurveWarning: You have passed both a numax and a frequency limit. The frequency limit will override the numax input.
LightkurveWarning)
Traceback (most recent call last):
File "", line 1, in
AttributeError: 'NoneType' object has no attribute 'savefig'
@rgarcibus - Welcome :) . Thanks for reporting this!
@nielsenmb plot_echelle does not return a figure object so this is why it does not work. I guess it should. I'm going to fix this now and open a PR unless you are already on this.
Update - we use the lightkurve plot_echelle function and that doesn't give us access to the fig object. I guess this is why @nielsenmb you didn't return the fig object.
@ojhall94 I'm going to change this in lightkurve so that plot_echelle accepts an ax but if ax is None then create the fig and ax. I'll do this unless you know of a good reason not to :)
You mean open a PR? I can't see a reason why it wouldn't be possible, but I'm also not sure why I didn't implement it in the first place. Weird!
Yes a PR - just re-reading the contributing guidelines now :)
PR is submitted - will probably want to wait to the next lk release before updating PBjam.
Lightkurve 1.5 has been released and is pip installable. It has the update to the seismology.plot_echelle() function that we need. I will now deal with the fig return in our plot_echelle() and I update the requirements.
close this?
Indeed!