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