本文整理汇总了Python中mpl_toolkits.axes_grid.axislines.SubplotZero.set_xlabel方法的典型用法代码示例。如果您正苦于以下问题:Python SubplotZero.set_xlabel方法的具体用法?Python SubplotZero.set_xlabel怎么用?Python SubplotZero.set_xlabel使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mpl_toolkits.axes_grid.axislines.SubplotZero
的用法示例。
在下文中一共展示了SubplotZero.set_xlabel方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: run
# 需要导入模块: from mpl_toolkits.axes_grid.axislines import SubplotZero [as 别名]
# 或者: from mpl_toolkits.axes_grid.axislines.SubplotZero import set_xlabel [as 别名]
def run(self, results):
par = self.getValueOfParameter("parameter")
i = int(self.getValueOfParameter("iteration number"))
title = self.getValueOfParameter("title")
if(par==""):
return False
if(i >= results.__len__()):
return False
dialogform = Dialog(QApplication.activeWindow())
fig = Figure((5.0, 4.0), dpi=100)
ax = SubplotZero(fig, 1, 1, 1)
fig.add_subplot(ax)
for n in ["top", "right"]:
ax.axis[n].set_visible(False)
for n in ["bottom", "left"]:
ax.axis[n].set_visible(True)
x = results[i].getResults(par)
if(not(x.__len__())):
return False
ax.hist(x, 100, normed=1)
ax.set_xlabel('Error')
ax.set_ylabel('Probability')
ax.grid(True)
ax.set_title(title)
dialogform.showFigure(fig)
return True
示例2: draw_graph
# 需要导入模块: from mpl_toolkits.axes_grid.axislines import SubplotZero [as 别名]
# 或者: from mpl_toolkits.axes_grid.axislines.SubplotZero import set_xlabel [as 别名]
def draw_graph(self):
min_time = 0
max_time = 0
for val in self.readings:
if min_time == 0:
min_time = val["time"]
if val["time"] < min_time:
min_time = val["time"]
if max_time == 0:
max_time = val["time"]
if val["time"] > max_time:
max_time = val["time"]
fig = plt.figure(1)
fig.subplots_adjust(right=0.85)
ax = SubplotZero(fig, 1, 1, 1)
fig.add_subplot(ax)
plt.title("Score for Game: %s" % self.score)
# make right and top axis invisible
ax.axis["right"].set_visible(False)
ax.axis["top"].set_visible(False)
# make xzero axis (horizontal axis line through y=0) visible.
ax.axis["xzero"].set_visible(False)
ax.set_xlim(min_time, max_time)
ax.set_ylim(0, 4)
ax.set_xlabel("Time")
ax.set_ylabel("HRV")
t_hrv = []
hrv = []
for val in self.readings:
if "hrv" in val.keys():
t_hrv.append(val["time"])
hrv.append(val["hrv"])
else:
ax.plot(val["time"], 2.0, 'r.')
for peak in self.peaks:
ax.plot(peak["time"], peak["hrv"], 'g.', markersize=10)
ax.plot(t_hrv, hrv, 'b-')
plt.savefig('pulse_graph')
示例3: enumerate
# 需要导入模块: from mpl_toolkits.axes_grid.axislines import SubplotZero [as 别名]
# 或者: from mpl_toolkits.axes_grid.axislines.SubplotZero import set_xlabel [as 别名]
for i, name in enumerate(PSET.populationParameters['me_type']):
p = f['CURRENT_DIPOLE_MOMENT'][name]
# four-sphere volume conductor
sphere = FourSphereVolumeConductor(
**PSET.foursphereParams
)
phi_p += sphere.calc_potential(p=p,
rz=np.array([0, 0, PSET.foursphereParams['radii'][0] + PSET.layer_data['center'][3:][i % 2]]),)
vlimround = plotting.draw_lineplot(ax=ax, data=plotting.decimate(phi_p, q=PSET.decimate_q)[::-1, ]*1E3, unit=r'$\mu$V', #mV -> µV unit conversion
dt=PSET.dt*PSET.decimate_q,
T=T, color='k', scalebarbasis='log10')
ax.set_xticklabels([])
ax.set_xlabel('')
ax.set_yticklabels(['{}'.format(i+1) for i in range(sphere.rxyz.shape[0])])
ax.set_ylabel('position', labelpad=10)
ax.text(-0.1, 1.05, alphabet[6],
horizontalalignment='center',
verticalalignment='center',
fontsize=16, fontweight='demibold',
transform=ax.transAxes)
# PANEL H. tangential component of MEG signal (as recorded by squid outside scull)
# compute the radial unit vector from the center of the sphere to each
示例4: SubplotZero
# 需要导入模块: from mpl_toolkits.axes_grid.axislines import SubplotZero [as 别名]
# 或者: from mpl_toolkits.axes_grid.axislines.SubplotZero import set_xlabel [as 别名]
import matplotlib.pyplot as plt
from mpl_toolkits.axes_grid.axislines import SubplotZero
if 1:
fig = plt.figure(1)
fig.subplots_adjust(right=0.85)
ax = SubplotZero(fig, 1, 1, 1)
fig.add_subplot(ax)
ax.axis["right"].set_visible(False)
ax.axis["top"].set_visible(False)
ax.axis["xzero"].set_visible(True)
ax.axis["xzero"].label.set_text("Axis Zero")
ax.set_ylim(-2, 4)
ax.set_xlabel("Label X")
ax.set_ylabel("Label Y")
offset = (20, 0)
new_axisline = ax.get_grid_helper().new_fixed_axis
ax.axis["right2"] = new_axisline(loc="right",
offset=offset,
axes=ax)
ax.axis["right2"].label.set_text("Label Y2")
ax.plot([-2,3,2])
plt.draw()
plt.show()
示例5: main
# 需要导入模块: from mpl_toolkits.axes_grid.axislines import SubplotZero [as 别名]
# 或者: from mpl_toolkits.axes_grid.axislines.SubplotZero import set_xlabel [as 别名]
def main():
f = open("game_output.txt", "r")
l = json.load(f)
min_time = 0
for val in l:
if min_time == 0:
min_time = val["time"]
if val["time"] < min_time:
min_time = val["time"]
max_time = 0
for val in l:
if max_time == 0:
max_time = val["time"]
if val["time"] > max_time:
max_time = val["time"]
print "%s %s" % (min_time, max_time)
fig = plt.figure(1)
fig.subplots_adjust(right=0.85)
ax = SubplotZero(fig, 1, 1, 1)
fig.add_subplot(ax)
# make right and top axis invisible
ax.axis["right"].set_visible(False)
ax.axis["top"].set_visible(False)
# make xzero axis (horizontal axis line through y=0) visible.
ax.axis["xzero"].set_visible(False)
#ax.axis["xzero"].label.set_text("Axis Zero")
ax.set_xlim(min_time, max_time)
ax.set_ylim(0, 4)
ax.set_xlabel("Time")
ax.set_ylabel("HRV")
# make new (right-side) yaxis, but wth some offset
# offset = (20, 0)
# new_axisline = ax.get_grid_helper().new_fixed_axis
# ax.axis["right2"] = new_axisline(loc="right",
# offset=offset,
# axes=ax)
# ax.axis["right2"].label.set_text("Label Y2")
#ax.plot([-2,3,2])
t_hrv = []
hrv = []
for val in l:
if "hrv" in val.keys():
t_hrv.append(val["time"])
hrv.append(val["hrv"])
#ax.plot(val["time"], val["hrv"], 'b,')
elif "key" in val.keys():
ax.plot(val["time"], 2.0, 'r,')
ax.plot(t_hrv, hrv, 'b-')
hrv_dict = []
for el in l:
try:
hrv_dict.append((el["time"], el["hrv"]))
except KeyError:
pass
peak_dict = []
current_peak = 0
hrv_window = deque()
hrv_limit = 20
hrv_total = []
stop_counter = 0
hrv_itr = hrv_dict.__iter__()
b = hrv_itr.next()
while 1:
a = [b[0], b[1], 0]
hrv_window.append(a)
hrv_total.append(a)
if len(hrv_window) > hrv_limit:
hrv_window.popleft()
max_hrv = 0
max_time = 0
for h in hrv_window:
if h[1] > max_hrv:
max_time = h[0]
max_hrv = h[1]
for h in hrv_window:
if h[0] == max_time:
h[2] = h[2] + 1
break
try:
c = hrv_itr.next()
b = c
except StopIteration:
stop_counter = stop_counter + 1
if stop_counter == hrv_limit:
break
pulse = 0
for (time, hrv, score) in hrv_total:
#.........这里部分代码省略.........