如何解决在matplotlib中切断多个图中的重叠图
我做了这个代码,效果很好。
import matplotlib.pyplot as plt
import numpy as np
import pylab
from matplotlib.figure import Figure
epsilon = np.linspace (0.001,1,50)
plt.figure(figsize = (18,7),dpi = 80)
fig = Figure()
nu_1 = np.linspace ( 0.3,0.3,50)
N = np.linspace (0,60,50)
N = ((2*(8.8 *10**(-9) - ((8.8 *10**(-9))+(3.513))/(8.8 *10**(-9))))/epsilon*(4*(3.513)+1)**(1/2))* np.arctanh(nu_1)
nu_2 = np.linspace ( 0.2,0.2,50)
M = np.linspace (0,50)
M = ((2*((1.007 *10**(-6)) - ((1.007 *10**(-6))+(3.855))/(1.007 *10**(-6))))/epsilon*(4*(3.855)+1)**(1/2))* np.arctanh(nu_2)
nu_3 = np.linspace ( 0.4,0.4,50)
L = np.linspace (0,50)
L = ((2*((6.72 *10**(-7)) - ((6.72 *10**(-7))+(2.68))/(6.72 *10**(-7))))/epsilon*(4*(2.68)+1)**(1/2))* np.arctanh(nu_3)
plt.subplot(1,3,1)
plt.plot(N,epsilon,color = 'firebrick',linewidth = (1),label = r'$ \xi = 1.6 \times 10^{-3} $')
plt.legend (loc='upper left',fontsize = 15)
plt.xlabel('Number of E-folds',fontsize = 19)
plt.ylabel('$\epsilon_2$',fontsize = 19)
plt.xticks([0,10,20,30,40,50,60],fontsize = 13)
plt.yticks([0.00001,0.0001,0.001,0.01,0.1,1],fontsize = 13)
plt.subplot(1,2)
plt.plot(M,color = 'darkgreen',label = r'$ \xi = 1.4 \times 10^{-5} $')
plt.legend(loc='upper left',fontsize = 15)
plt.xlabel('Number of E-folds',fontsize = 19)
plt.xticks([0,fontsize = 13)
plt.subplot(1,3)
plt.plot (L,color = 'navy',label = r'$ \xi = 2.1 \times 10^{-5} $')
plt.xlabel('Number of E-folds',fontsize = 19)
plt.legend(loc='upper left',fontsize = 15)
plt.xticks([0,fontsize = 13)
plt.tight_layout(6)
plt.show()
the first result in subplot 但是当我想在一个图中绘制所有这些图形时,其中 2 个被剪掉了,只有一个是完整的。在这方面我应该怎么做? 问题与重叠有关吗?我想看到所有这些数字的重叠。
import matplotlib.pyplot as plt
import numpy as np
import pylab
from matplotlib.figure import Figure
epsilon = np.linspace (0.001,50)
plt.figure(figsize = (7,5),50)
L = ((2*((6.72 *10**(-7)) - ((6.72 *10**(-7))+(2.68))/(6.72 *10**(-7))))/epsilon*(4*(2.68)+1)**(1/2))* np.arctanh(nu_3)
plt.xticks([0.00001,fontsize = 10)
plt.yticks([0.00001,fontsize = 10)
plt.plot(N,label = r'$ \xi = 1.6 \times 10^{-3} $')
plt.plot(M,label = r'$ \xi = 1.4 \times 10^{-5} $')
plt.plot (L,label = r'$ \xi = 2.1 \times 10^{-5} $')
plt.legend(loc='upper left',fontsize = 14)
plt.xlabel('Number of E-folds',fontsize = 15)
plt.ylabel('$\epsilon_2$',fontsize = 15)
plt.show()
the red circle is the place where plots are cut
我该怎么办?我想看到重叠。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。