本文整理汇总了Python中matplotlib.figure.SubplotParams方法的典型用法代码示例。如果您正苦于以下问题:Python figure.SubplotParams方法的具体用法?Python figure.SubplotParams怎么用?Python figure.SubplotParams使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类matplotlib.figure
的用法示例。
在下文中一共展示了figure.SubplotParams方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get_subplot_params
# 需要导入模块: from matplotlib import figure [as 别名]
# 或者: from matplotlib.figure import SubplotParams [as 别名]
def get_subplot_params(self, fig=None):
"""
return a dictionary of subplot layout parameters. The default
parameters are from rcParams unless a figure attribute is set.
"""
from matplotlib.figure import SubplotParams
import copy
if fig is None:
kw = dict([(k, rcParams["figure.subplot."+k]) \
for k in self._AllowedKeys])
subplotpars = SubplotParams(**kw)
else:
subplotpars = copy.copy(fig.subplotpars)
update_kw = dict([(k, getattr(self, k)) for k in self._AllowedKeys])
subplotpars.update(**update_kw)
return subplotpars
示例2: timeseries
# 需要导入模块: from matplotlib import figure [as 别名]
# 或者: from matplotlib.figure import SubplotParams [as 别名]
def timeseries(X, **kwargs):
"""Plot X. See timeseries_subplot."""
pl.figure(
figsize=tuple(2 * s for s in rcParams['figure.figsize']),
subplotpars=sppars(left=0.12, right=0.98, bottom=0.13),
)
timeseries_subplot(X, **kwargs)
示例3: load_figure
# 需要导入模块: from matplotlib import figure [as 别名]
# 或者: from matplotlib.figure import SubplotParams [as 别名]
def load_figure(d, new_fig=True):
"""Create a figure from what is returned by :meth:`inspect_figure`"""
import matplotlib.pyplot as plt
subplotpars = d.pop('subplotpars', None)
if subplotpars is not None:
subplotpars.pop('validate', None)
subplotpars = mfig.SubplotParams(**subplotpars)
if new_fig:
nums = plt.get_fignums()
if d.get('num') in nums:
d['num'] = next(
i for i in range(max(plt.get_fignums()) + 1, 0, -1)
if i not in nums)
return plt.figure(subplotpars=subplotpars, **d)