当前位置: 首页>>代码示例>>Python>>正文


Python Lightcurve.plot方法代码示例

本文整理汇总了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)
开发者ID:abigailStev,项目名称:stingray,代码行数:9,代码来源:test_lightcurve.py

示例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()"
开发者ID:abigailStev,项目名称:stingray,代码行数:13,代码来源:test_lightcurve.py

示例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)
开发者ID:abigailStev,项目名称:stingray,代码行数:6,代码来源:test_lightcurve.py

示例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)
开发者ID:abigailStev,项目名称:stingray,代码行数:6,代码来源:test_lightcurve.py

示例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')
开发者ID:abigailStev,项目名称:stingray,代码行数:7,代码来源:test_lightcurve.py

示例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')
开发者ID:abigailStev,项目名称:stingray,代码行数:7,代码来源:test_lightcurve.py

示例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)
开发者ID:abigailStev,项目名称:stingray,代码行数:7,代码来源:test_lightcurve.py

示例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)
开发者ID:abigailStev,项目名称:stingray,代码行数:6,代码来源:test_lightcurve.py


注:本文中的stingray.Lightcurve.plot方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。