本文整理匯總了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()))