本文整理汇总了Python中stingray.Lightcurve.plot方法的典型用法代码示例。如果您正苦于以下问题:Python Lightcurve.plot方法的具体用法?Python Lightcurve.plot怎么用?Python Lightcurve.plot使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类stingray.Lightcurve
的用法示例。
在下文中一共展示了Lightcurve.plot方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_plot_wrong_label_type
# 需要导入模块: from stingray import Lightcurve [as 别名]
# 或者: from stingray.Lightcurve import plot [as 别名]
def test_plot_wrong_label_type(self):
lc = Lightcurve(self.times, self.counts)
with pytest.raises(TypeError):
with warnings.catch_warnings(record=True) as w:
lc.plot(labels=123)
assert "must be either a list or tuple" in str(w[0].message)
示例2: test_plot_matplotlib_not_installed
# 需要导入模块: from stingray import Lightcurve [as 别名]
# 或者: from stingray.Lightcurve import plot [as 别名]
def test_plot_matplotlib_not_installed(self):
try:
import matplotlib.pyplot as plt
except Exception as e:
lc = Lightcurve(self.times, self.counts)
try:
lc.plot()
except Exception as e:
assert type(e) is ImportError
assert str(e) == "Matplotlib required for plot()"
示例3: test_plot_title
# 需要导入模块: from stingray import Lightcurve [as 别名]
# 或者: from stingray.Lightcurve import plot [as 别名]
def test_plot_title(self):
lc = Lightcurve(self.times, self.counts)
lc.plot(title="Test Lightcurve")
assert plt.fignum_exists(1)
示例4: test_plot_axis
# 需要导入模块: from stingray import Lightcurve [as 别名]
# 或者: from stingray.Lightcurve import plot [as 别名]
def test_plot_axis(self):
lc = Lightcurve(self.times, self.counts)
lc.plot(axis=[0, 1, 0, 100])
assert plt.fignum_exists(1)
示例5: test_plot_custom_filename
# 需要导入模块: from stingray import Lightcurve [as 别名]
# 或者: from stingray.Lightcurve import plot [as 别名]
def test_plot_custom_filename(self):
lc = Lightcurve(self.times, self.counts)
lc.plot(save=True, filename='lc.png')
assert os.path.isfile('lc.png')
os.unlink('lc.png')
示例6: test_plot_default_filename
# 需要导入模块: from stingray import Lightcurve [as 别名]
# 或者: from stingray.Lightcurve import plot [as 别名]
def test_plot_default_filename(self):
lc = Lightcurve(self.times, self.counts)
lc.plot(save=True)
assert os.path.isfile('out.png')
os.unlink('out.png')
示例7: test_plot_labels_index_error
# 需要导入模块: from stingray import Lightcurve [as 别名]
# 或者: from stingray.Lightcurve import plot [as 别名]
def test_plot_labels_index_error(self):
lc = Lightcurve(self.times, self.counts)
with warnings.catch_warnings(record=True) as w:
lc.plot(labels=('x'))
assert "must have two labels" in str(w[0].message)
示例8: test_plot_simple
# 需要导入模块: from stingray import Lightcurve [as 别名]
# 或者: from stingray.Lightcurve import plot [as 别名]
def test_plot_simple(self):
lc = Lightcurve(self.times, self.counts)
lc.plot()
assert plt.fignum_exists(1)