本文整理汇总了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()))
示例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)
示例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()))