-
Notifications
You must be signed in to change notification settings - Fork 43
Expand file tree
/
Copy pathviews.py
More file actions
27 lines (24 loc) · 797 Bytes
/
views.py
File metadata and controls
27 lines (24 loc) · 797 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
"""Module containing code for plotting a lightcurve."""
from matplotlib import pyplot as plt
import pandas as pd
def plotUnfolded(data,mag_col,time_col,color,marker):
"""
Display plots of unfolded lightcurves in different bands.
:param data: a table of observations of a single object in a single band
:param mag_col: the name of the column with magnitudes to plot
:param time_col: the name of the column with time stamps
"""
fig = plt.figure(figsize=(7,5))
ax = fig.add_subplot(1,1,1)
ax.scatter(
data[time_col],
data[mag_col],
color=color,
marker=marker
)
ax.minorticks_on()
ax.set_xlabel("MJD (days)")
ax.set_ylabel('Mag' + mag_col)
ax.set_title('Light curve')
fig.tight_layout()
plt.show()