spedas / pyspedas

Python-based Space Physics Environment Data Analysis Software
https://pyspedas.readthedocs.io/
MIT License
143 stars 58 forks source link

Double suffixes when saving plots as png, eps, etc #802

Closed jameswilburlewis closed 3 months ago

jameswilburlewis commented 3 months ago

In tplot we have:

    if save_png is not None and save_png != '':
        plt.savefig(save_png + '.png', dpi=dpi)

and similar for other output formats. We should check whether there's already a suffix before adding '.png' or whatever, to avoid filenames like myplot.png.png.

nickssl commented 3 months ago

The same problem appears in pyspedas:

mms_orbit_plot.py mms_fpi_and_ang.py (this is somewhat different) slice2d_plot.py

nickssl commented 3 months ago

Fixed.