I’m struggling with matplotlib
.
I’d like to get a plot like this one but with the code below I can only get this plot.
<code>f, (ax1, ax2, ax3) = plt.subplots(3, sharex=True, sharey=False)
ax1 = plt.gca()
ax1.yaxis.set_inverted(True)
ax1.plot(bp_phase, bp_mag, 'o', markersize=7, markerfacecolor="#BFCFFF",
markeredgewidth=1, markeredgecolor='black')
ax1.plot(bp_phase_snd_cycle, bp_mag, 'o', markersize=7, markerfacecolor="#BFCFFF",
markeredgewidth=1, markeredgecolor='black')
ax2.yaxis.set_inverted(True)
ax2.plot(g_phase, g_mag, 'o', markersize=7, markerfacecolor="#99FF99",
markeredgewidth=1, markeredgecolor='black')
ax2.plot(g_phase_snd_cycle, g_mag, 'o', markersize=7, markerfacecolor="#99FF99",
markeredgewidth=1, markeredgecolor='black')
ax3.yaxis.set_inverted(True)
ax3.plot(rp_phase, rp_mag, 'o', markersize=7, markerfacecolor="#ffa500",
markeredgewidth=1, markeredgecolor='black')
ax3.plot(bp_phase_snd_cycle, rp_mag, 'o', markersize=7, markerfacecolor="#ffa500",
markeredgewidth=1, markeredgecolor='black')
plt.xticks(fontsize=14, rotation=90)
plt.yticks(fontsize=14)
f.subplots_adjust(hspace=0)
plt.setp([a.get_xticklabels() for a in f.axes[:-1]], visible=False)
</code>
<code>f, (ax1, ax2, ax3) = plt.subplots(3, sharex=True, sharey=False)
ax1 = plt.gca()
ax1.yaxis.set_inverted(True)
ax1.plot(bp_phase, bp_mag, 'o', markersize=7, markerfacecolor="#BFCFFF",
markeredgewidth=1, markeredgecolor='black')
ax1.plot(bp_phase_snd_cycle, bp_mag, 'o', markersize=7, markerfacecolor="#BFCFFF",
markeredgewidth=1, markeredgecolor='black')
ax2.yaxis.set_inverted(True)
ax2.plot(g_phase, g_mag, 'o', markersize=7, markerfacecolor="#99FF99",
markeredgewidth=1, markeredgecolor='black')
ax2.plot(g_phase_snd_cycle, g_mag, 'o', markersize=7, markerfacecolor="#99FF99",
markeredgewidth=1, markeredgecolor='black')
ax3.yaxis.set_inverted(True)
ax3.plot(rp_phase, rp_mag, 'o', markersize=7, markerfacecolor="#ffa500",
markeredgewidth=1, markeredgecolor='black')
ax3.plot(bp_phase_snd_cycle, rp_mag, 'o', markersize=7, markerfacecolor="#ffa500",
markeredgewidth=1, markeredgecolor='black')
plt.xticks(fontsize=14, rotation=90)
plt.yticks(fontsize=14)
f.subplots_adjust(hspace=0)
plt.setp([a.get_xticklabels() for a in f.axes[:-1]], visible=False)
</code>
f, (ax1, ax2, ax3) = plt.subplots(3, sharex=True, sharey=False)
ax1 = plt.gca()
ax1.yaxis.set_inverted(True)
ax1.plot(bp_phase, bp_mag, 'o', markersize=7, markerfacecolor="#BFCFFF",
markeredgewidth=1, markeredgecolor='black')
ax1.plot(bp_phase_snd_cycle, bp_mag, 'o', markersize=7, markerfacecolor="#BFCFFF",
markeredgewidth=1, markeredgecolor='black')
ax2.yaxis.set_inverted(True)
ax2.plot(g_phase, g_mag, 'o', markersize=7, markerfacecolor="#99FF99",
markeredgewidth=1, markeredgecolor='black')
ax2.plot(g_phase_snd_cycle, g_mag, 'o', markersize=7, markerfacecolor="#99FF99",
markeredgewidth=1, markeredgecolor='black')
ax3.yaxis.set_inverted(True)
ax3.plot(rp_phase, rp_mag, 'o', markersize=7, markerfacecolor="#ffa500",
markeredgewidth=1, markeredgecolor='black')
ax3.plot(bp_phase_snd_cycle, rp_mag, 'o', markersize=7, markerfacecolor="#ffa500",
markeredgewidth=1, markeredgecolor='black')
plt.xticks(fontsize=14, rotation=90)
plt.yticks(fontsize=14)
f.subplots_adjust(hspace=0)
plt.setp([a.get_xticklabels() for a in f.axes[:-1]], visible=False)
I can’t figure out why there is an empty slot while two functions got plotted on the same one.
NB: I can’t provide the plotting data, maybe some matplotlib
guru can understand anyway where is my mistake.
Thank you
2