matplotlib: die Abstimmung der y-Achsenbeschriftungen in gestapelten scatter-plots

In der Handlung Balg habe ich zwei scatter-plots, die haben unterschiedliche Anzahl skalieren, so dass Ihre Y-Achsen-Beschriftungen sind nicht ausgerichtet. Gibt es eine Möglichkeit, ich kann erzwingen, dass die horizontale Ausrichtung in der y-Achsen-Beschriftungen?

import matplotlib.pylab as plt
import random
import matplotlib.gridspec as gridspec

random.seed(20)
data1 = [random.random() for i in range(10)]
data2 = [random.random()*1000 for i in range(10)]

gs = gridspec.GridSpec(2,1)
fig = plt.figure()

ax = fig.add_subplot(gs[0])
ax.plot(data1)
ax.set_ylabel(r'Label One', size =16)

ax = fig.add_subplot(gs[1])
ax.plot(data2)
ax.set_ylabel(r'Label Two', size =16)

plt.show()

matplotlib: die Abstimmung der y-Achsenbeschriftungen in gestapelten scatter-plots

InformationsquelleAutor dimka | 2013-10-09
Schreibe einen Kommentar