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


Python matplotlib._all_deprecated方法代码示例

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


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

示例1: test_if_rctemplate_is_up_to_date

# 需要导入模块: import matplotlib [as 别名]
# 或者: from matplotlib import _all_deprecated [as 别名]
def test_if_rctemplate_is_up_to_date():
    # This tests if the matplotlibrc.template file contains all valid rcParams.
    deprecated = {*mpl._all_deprecated, *mpl._deprecated_remain_as_none}
    path_to_rc = os.path.join(mpl.get_data_path(), 'matplotlibrc')
    with open(path_to_rc, "r") as f:
        rclines = f.readlines()
    missing = {}
    for k, v in mpl.defaultParams.items():
        if k[0] == "_":
            continue
        if k in deprecated:
            continue
        if k.startswith(
                ("verbose.", "examples.directory", "text.latex.unicode")):
            continue
        found = False
        for line in rclines:
            if k in line:
                found = True
        if not found:
            missing.update({k: v})
    if missing:
        raise ValueError("The following params are missing in the "
                         "matplotlibrc.template file: {}"
                         .format(missing.items())) 
开发者ID:holzschu,项目名称:python3_ios,代码行数:27,代码来源:test_rcparams.py

示例2: __init__

# 需要导入模块: import matplotlib [as 别名]
# 或者: from matplotlib import _all_deprecated [as 别名]
def __init__(self, rc=None, fname=None, use_defaults=True):
        theme.__init__(
            self,
            aspect_ratio=get_option('aspect_ratio'),
            dpi=get_option('dpi'),
            figure_size=get_option('figure_size'),
            legend_key=element_rect(fill='None', colour='None'),
            legend_key_size=16,
            panel_spacing=0.1,
            strip_background=element_rect(
                fill='#D9D9D9', color='#D9D9D9', size=1),
            complete=True)

        if use_defaults:
            _copy = mpl.rcParams.copy()
            deprecated_rcparams = (
                set(mpl._deprecated_remain_as_none)
                | set(mpl._all_deprecated)
            )
            # no need to a get a deprecate warning just because
            # they are still included in rcParams...
            for key in deprecated_rcparams:
                if key in _copy:
                    del _copy[key]
            if 'tk.pythoninspect' in _copy:
                del _copy['tk.pythoninspect']
            self._rcParams.update(_copy)

        if fname:
            self._rcParams.update(mpl.rc_params_from_file(fname))
        if rc:
            self._rcParams.update(rc) 
开发者ID:has2k1,项目名称:plotnine,代码行数:34,代码来源:theme_matplotlib.py

示例3: test_if_rctemplate_is_up_to_date

# 需要导入模块: import matplotlib [as 别名]
# 或者: from matplotlib import _all_deprecated [as 别名]
def test_if_rctemplate_is_up_to_date():
    # This tests if the matplotlibrc.template file
    # contains all valid rcParams.
    dep1 = mpl._all_deprecated
    dep2 = mpl._deprecated_set
    deprecated = list(dep1.union(dep2))
    path_to_rc = os.path.join(mpl.get_data_path(), 'matplotlibrc')
    with open(path_to_rc, "r") as f:
        rclines = f.readlines()
    missing = {}
    for k, v in mpl.defaultParams.items():
        if k[0] == "_":
            continue
        if k in deprecated:
            continue
        if "verbose" in k:
            continue
        found = False
        for line in rclines:
            if k in line:
                found = True
        if not found:
            missing.update({k: v})
    if missing:
        raise ValueError("The following params are missing " +
                         "in the matplotlibrc.template file: {}"
                         .format(missing.items())) 
开发者ID:alvarobartt,项目名称:twitter-stock-recommendation,代码行数:29,代码来源:test_rcparams.py


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