def test_plotting():
# check that plotting at least succeeds with allowed arguments
t = np.random.uniform(55555., 56012., size=128)
rv = 100 * np.sin(0.5*t) * u.km/u.s
ivar = 1 / (np.random.normal(0,5,size=t.size)*u.km/u.s)**2
data = RVData(t=t, rv=rv, ivar=ivar)
data.plot()
# style
data.plot(color='r')
# custom axis
fig,ax = plt.subplots(1,1)
data.plot(ax=plt.gca())
# formatting
data.plot(rv_unit=u.m/u.s)
data.plot(rv_unit=u.m/u.s, time_format='jd')
data.plot(rv_unit=u.m/u.s, time_format=lambda x: x.utc.mjd)
# try with no errors
data = RVData(t=t, rv=rv)
data.plot()
data.plot(ecolor='r')
plt.close('all')
评论列表
文章目录