Jede Hilfe in den subplot2grid bekommen und die Achsen Etiketten werden gut zusammen arbeiten werden, so sehr geschätzt. Wie Sie in der Abbildung sehen können, überlappen einige der Achsenbeschriftungen die Oberfläche der benachbarten Unterplots.
Anbei ein paar Code, falls es hilft.Matplotlib subplot2grid mit Achsen Verpackungsetiketten
def init_plot(self):
self.f0 = plt.figure(num = 0, figsize = (12, 8))#, dpi = 100)
self.f0.suptitle("CFM diffusion", fontsize=12)
self.ax01 = plt.subplot2grid((2, 3), (0, 0))
self.ax02 = plt.subplot2grid((2, 3), (0, 1))
self.ax03 = plt.subplot2grid((2, 3), (1, 0))
self.ax04 = plt.subplot2grid((2, 3), (1, 1))
self.ax05 = plt.subplot2grid((2, 3), (0, 2))
self.ax06 = plt.subplot2grid((2, 3), (1, 2))
self.ax01.set_ylim((300, 0))
self.ax02.set_ylim((300,0))
self.ax03.set_ylim((230, 250))
self.ax04.set_ylim((0.08, 0.22))
self.ax02.set_xlim((230, 250))
self.ax03.set_xlim((self.model_time[0], self.model_time[-1]))
self.ax04.set_xlim((self.model_time[0], self.model_time[-1]))
self.ax05.set_ylim((300,0))
self.ax05.set_xlim((0, 0.125))
self.ax06.set_xlim((self.model_time[0], self.model_time[-1]))
self.ax06.set_ylim((0.08, 0.125))
self.ax01.set_ylabel(r"Depth [m]")
self.ax01.set_xlabel(r"Density [$\mathrm{kgm}^{-3}$]")
self.ax02.set_ylabel(r"Depth [m]")
self.ax02.set_xlabel(r"Temperature [K]")
self.ax03.set_ylabel(r"Temperature Forcing [K]")
self.ax03.set_xlabel(r"Model Time [y]")
self.ax04.set_ylabel(r"Accumulation Forcing [$\mathrm{my}^{-1}$ ice eq.]")
self.ax04.set_xlabel(r"Model Time [y]")
self.ax05.set_ylabel(r"Depth [m]")
self.ax05.set_xlabel(r"Diffusion Length [m]")
self.ax06.set_ylabel(r"$\sigma'_{18}$ [m]")
self.ax06.set_xlabel(r"Model Time [y]")
# self.ax01.set_title('Density profile')
# self.ax02.set_title('Temp. profile')
# self.ax03.set_title('Temperature Forcing')
# self.ax04.set_title('Accum Forcing')
# self.ax05.set_title('Diffusion Length')
# self.ax06.set_title('Diffusion Length at CO')
self.hlp011 = self.ax01.plot(self.rho_hl*1000, self.z_hl, "r--")
self.p011, = self.ax01.plot(self.rho[0][1:], self.z[0][1:],'b-')
self.p012, = self.ax02.plot(self.temperature[0][1:], self.z[0][1:], 'k-')
self.p021, = self.ax03.plot(self.climate[0,0], self.climate[0,2],'k-')
self.p022, = self.ax04.plot(self.climate[0,0], self.climate[0,1], 'k-')
print(self.climate[0,1])
self.p023, = self.ax05.plot(self.iso_sigmaD[0][1:], self.z[0][1:], 'r-')
self.p024, = self.ax05.plot(self.iso_sigma18[0][1:], self.z[0][1:], 'b-')
self.iso_sigma18_co = np.array((self.iso_sigma18[0][1:][self.rho[0][1:]>804.3][0],))
self.p025, = self.ax06.plot(self.climate[0,0], self.iso_sigma18_co[0], 'b-')
return
Genius Dank! Endgültige Antwort und Handlung unten. –