mzechmeister / GLS

Generalised Lomb-Scargle periodogram
MIT License
35 stars 5 forks source link

Option to turn off fitted plots #10

Closed zhexingli closed 4 years ago

zhexingli commented 4 years ago

Hello again, is there an option to have the plot only showing the peridogram, ie, leaving out the fitted plots? Thanks.

Zhexing

mzechmeister commented 4 years ago

Note the plot is only a working plot and not thought for publication. Plotting simply the periodogram is also easy via the attributes f and p

>>> import matplotlib.pyplot as plt
>>> plt.plot(gls.f, gls.p)
>>> plt.show()

But I see the need for such an option, since the built-in gls plot has some more enhancements like the period on the top axis, labels, and markers. So I implemented the plot arguments gls, data, and residuals; all set to true by default. https://github.com/mzechmeister/GLS/blob/73af7bcd6f15858de44c9838b948b5bea22cfb49/python/gls.py#L465 Now, to have only the periodogram, you can now toggle off the other subplots with

>>> gls.plot(data=False, residuals=False)
zhexingli commented 4 years ago

You're the best :)