本文整理汇总了Python中mpl_toolkits.axes_grid.axislines.SubplotZero.set_xticklabels方法的典型用法代码示例。如果您正苦于以下问题:Python SubplotZero.set_xticklabels方法的具体用法?Python SubplotZero.set_xticklabels怎么用?Python SubplotZero.set_xticklabels使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mpl_toolkits.axes_grid.axislines.SubplotZero
的用法示例。
在下文中一共展示了SubplotZero.set_xticklabels方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: make_plot_ax
# 需要导入模块: from mpl_toolkits.axes_grid.axislines import SubplotZero [as 别名]
# 或者: from mpl_toolkits.axes_grid.axislines.SubplotZero import set_xticklabels [as 别名]
def make_plot_ax():
fig = figure(figsize=(6, 5));
ax = SubplotZero(fig, 111); fig.add_subplot(ax)
for direction in ["xzero", "yzero"]:
ax.axis[direction].set_axisline_style("-|>")
ax.axis[direction].set_visible(True)
for direction in ["left", "right", "bottom", "top"]:
ax.axis[direction].set_visible(False)
xlim(-0.1, 2.1); ylim(xlim())
ticks = [0.5 * i for i in range(1, 5)]
labels = [str(i) if i == int(i) else "" for i in ticks]
ax.set_xticks(ticks); ax.set_yticks(ticks)
ax.set_xticklabels(labels); ax.set_yticklabels(labels)
ax.axis["yzero"].set_axis_direction("left")
return ax
示例2: renderGraph
# 需要导入模块: from mpl_toolkits.axes_grid.axislines import SubplotZero [as 别名]
# 或者: from mpl_toolkits.axes_grid.axislines.SubplotZero import set_xticklabels [as 别名]
def renderGraph(self): # pylint: disable=R0914
assert len(self._oData.aoSeries) == 1
oSeries = self._oData.aoSeries[0]
# hacking
# self.setWidth(512);
# self.setHeight(128);
# end
oFigure = self._createFigure()
from mpl_toolkits.axes_grid.axislines import SubplotZero
# pylint: disable=E0401
oAxis = SubplotZero(oFigure, 111)
oFigure.add_subplot(oAxis)
# Disable all the normal axis.
oAxis.axis["right"].set_visible(False)
oAxis.axis["top"].set_visible(False)
oAxis.axis["bottom"].set_visible(False)
oAxis.axis["left"].set_visible(False)
# Use the zero axis instead.
oAxis.axis["yzero"].set_axisline_style("-|>")
oAxis.axis["yzero"].set_visible(True)
oAxis.axis["xzero"].set_axisline_style("-|>")
oAxis.axis["xzero"].set_visible(True)
if oSeries.aoYValues[-1] == 100:
sColor = "green"
elif oSeries.aoYValues[-1] > 75:
sColor = "yellow"
else:
sColor = "red"
oAxis.plot(oSeries.aoXValues, oSeries.aoYValues, ".-", color=sColor, linewidth=3)
oAxis.fill_between(oSeries.aoXValues, oSeries.aoYValues, facecolor=sColor, alpha=0.5)
oAxis.set_xlim(left=-0.01)
oAxis.set_xticklabels([])
oAxis.set_xmargin(1)
oAxis.set_ylim(bottom=0, top=100)
oAxis.set_yticks([0, 50, 100])
oAxis.set_ylabel("%")
# oAxis.set_yticklabels([]);
oAxis.set_yticklabels(["", "%", ""])
return self._produceSvg(oFigure, False)
示例3: renderGraph
# 需要导入模块: from mpl_toolkits.axes_grid.axislines import SubplotZero [as 别名]
# 或者: from mpl_toolkits.axes_grid.axislines.SubplotZero import set_xticklabels [as 别名]
def renderGraph(self): # pylint: disable=R0914
assert len(self._oData.aoSeries) == 1;
oSeries = self._oData.aoSeries[0];
# hacking
#self.setWidth(512);
#self.setHeight(128);
# end
oFigure = self._createFigure();
from mpl_toolkits.axes_grid.axislines import SubplotZero;
oAxis = SubplotZero(oFigure, 111);
oFigure.add_subplot(oAxis);
# Disable all the normal axis.
oAxis.axis['right'].set_visible(False)
oAxis.axis['top'].set_visible(False)
oAxis.axis['bottom'].set_visible(False)
oAxis.axis['left'].set_visible(False)
# Use the zero axis instead.
oAxis.axis['yzero'].set_axisline_style('-|>');
oAxis.axis['yzero'].set_visible(True);
oAxis.axis['xzero'].set_axisline_style('-|>');
oAxis.axis['xzero'].set_visible(True);
if oSeries.aoYValues[-1] == 100:
sColor = 'green';
elif oSeries.aoYValues[-1] > 75:
sColor = 'yellow';
else:
sColor = 'red';
oAxis.plot(oSeries.aoXValues, oSeries.aoYValues, '.-', color = sColor, linewidth = 3);
oAxis.fill_between(oSeries.aoXValues, oSeries.aoYValues, facecolor = sColor, alpha = 0.5)
oAxis.set_xlim(left = -0.01);
oAxis.set_xticklabels([]);
oAxis.set_xmargin(1);
oAxis.set_ylim(bottom = 0, top = 100);
oAxis.set_yticks([0, 50, 100]);
oAxis.set_ylabel('%');
#oAxis.set_yticklabels([]);
oAxis.set_yticklabels(['', '%', '']);
return self._produceSvg(oFigure, False);
示例4: enumerate
# 需要导入模块: from mpl_toolkits.axes_grid.axislines import SubplotZero [as 别名]
# 或者: from mpl_toolkits.axes_grid.axislines.SubplotZero import set_xticklabels [as 别名]
ax.plot(np.cos(theta)*r, np.sin(theta)*r, 'C{}'.format(i), label=label + r', $r_%i=%i$ mm' % (i+1, r / 1000), clip_on=False)
# draw measurement points
ax.plot(PSET.foursphereParams['r'][:, 0], PSET.foursphereParams['r'][:, 2], 'ko', label='EEG/MEG sites')
for i, (x, y, z) in enumerate(PSET.foursphereParams['r']):
ax.text(x, z+2500, r'{}'.format(i+1), ha='center')
# dipole location
ax.plot([0], [PSET.foursphereParams['radii'][0] + PSET.layer_data['center'][3]], 'k.', label='dipole site')
ax.axis('equal')
ax.set_ylim(top=max(PSET.foursphereParams['radii']) + 5000)
ax.set_xticks(np.r_[-np.array(PSET.foursphereParams['radii']), 0, PSET.foursphereParams['radii']])
ax.set_xticklabels([])
ax.legend(loc=(0.25, 0.05), frameon=False)
ax.text(-0.1, 1.05, alphabet[5],
horizontalalignment='center',
verticalalignment='center',
fontsize=16, fontweight='demibold',
transform=ax.transAxes)
# PANEL G. EEG signal
ax = fig.add_subplot(gs[2, 2])
ax.set_title(r'surface potential $\phi_\mathbf{p}(\mathbf{r})$ ')