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


Python pyplot.Artist方法代码示例

本文整理汇总了Python中matplotlib.pyplot.Artist方法的典型用法代码示例。如果您正苦于以下问题:Python pyplot.Artist方法的具体用法?Python pyplot.Artist怎么用?Python pyplot.Artist使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在matplotlib.pyplot的用法示例。


在下文中一共展示了pyplot.Artist方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: assert_is_valid_plot_return_object

# 需要导入模块: from matplotlib import pyplot [as 别名]
# 或者: from matplotlib.pyplot import Artist [as 别名]
def assert_is_valid_plot_return_object(objs):  # pragma: no cover
    import matplotlib.pyplot as plt

    if isinstance(objs, (pd.Series, np.ndarray)):
        for el in objs.ravel():
            msg = (
                "one of 'objs' is not a matplotlib Axes instance, "
                "type encountered {}".format(repr(type(el).__name__))
            )
            assert isinstance(el, (plt.Axes, dict)), msg
    else:
        msg = (
            "objs is neither an ndarray of Artist instances nor a single "
            "ArtistArtist instance, tuple, or dict, 'objs' is a {}".format(
                repr(type(objs).__name__))
        )
        assert isinstance(objs, (plt.Artist, tuple, dict)), msg 
开发者ID:mars-project,项目名称:mars,代码行数:19,代码来源:test_plot.py

示例2: assert_is_valid_plot_return_object

# 需要导入模块: from matplotlib import pyplot [as 别名]
# 或者: from matplotlib.pyplot import Artist [as 别名]
def assert_is_valid_plot_return_object(objs):
    import matplotlib.pyplot as plt
    if isinstance(objs, (pd.Series, np.ndarray)):
        for el in objs.ravel():
            msg = ("one of 'objs' is not a matplotlib Axes instance, type "
                   "encountered {name!r}").format(name=el.__class__.__name__)
            assert isinstance(el, (plt.Axes, dict)), msg
    else:
        assert isinstance(objs, (plt.Artist, tuple, dict)), (
            'objs is neither an ndarray of Artist instances nor a '
            'single Artist instance, tuple, or dict, "objs" is a {name!r}'
            .format(name=objs.__class__.__name__)) 
开发者ID:Frank-qlu,项目名称:recruit,代码行数:14,代码来源:testing.py

示例3: assert_is_valid_plot_return_object

# 需要导入模块: from matplotlib import pyplot [as 别名]
# 或者: from matplotlib.pyplot import Artist [as 别名]
def assert_is_valid_plot_return_object(objs):
    import matplotlib.pyplot as plt
    if isinstance(objs, (pd.Series, np.ndarray)):
        for el in objs.ravel():
            msg = ('one of \'objs\' is not a matplotlib Axes instance, type '
                   'encountered {name!r}').format(name=el.__class__.__name__)
            assert isinstance(el, (plt.Axes, dict)), msg
    else:
        assert isinstance(objs, (plt.Artist, tuple, dict)), \
            ('objs is neither an ndarray of Artist instances nor a '
             'single Artist instance, tuple, or dict, "objs" is a {name!r}'
             ).format(name=objs.__class__.__name__) 
开发者ID:birforce,项目名称:vnpy_crypto,代码行数:14,代码来源:testing.py


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