我对 matplotlib 中的等高线图有一些问题。我把我的情节分成4个区域,
a1=zeros((100,100))
a2=zeros((100,100))
a3=zeros((100,100))
a4=zeros((100,100))
x=np.linspace(x1,x2,100) #x1,x2,y1,y2 and so on are boundaries I didnt include here
y=np.linspace(y1,y2,100)
xneu=np.linspace(x2,x3,100)
yneu=np.linspace(y1,y2,100)
yo=np.linspace(y1,y3,100)
#Four areas X,Y X1,Y1 X2,Y2 X3,Y3
X, Y=np.meshgrid(x, y)
X1, Y1=np.meshgrid(xneu, y)
X2,Y2=np.meshgrid(x,yo)
X3,Y3=np.meshgrid(xneu,yo)
#filling my arrays with wanted values , f's are functions I haven't included here
for i in arange(0,len(y)):
werte[i]=f(y[i])
for j in arange(0, len(xneu)):
for i in arange(0, len(yneu)):
werte2[i][j]=f1(xneu[i],yneu[j]) + f3(xneu[i],yneu[j]) + f5(xneu[i],yneu[j]) + f7(xneu[i],yneu[j]) + f9(xneu[i],yneu[j])
for i in arange(0,len(yo)):
werte3[i]=f(y[i])
for j in arange(0, len(xneu)):
for i in arange(0, len(yo)):
werte4[i][j]=f1(xneu[i],yo[j]) + f3(xneu[i],yo[j]) + f5(xneu[i],yo[j]) + f7(xneu[i],yo[j]) + f9(xneu[i],yo[j])
cs = plt.contourf(X, Y, werte, 10)
ds = plt.contourf(X1, Y1, werte2, 10)
es = plt.contourf(X2, Y2, werte3, 10)
fs = plt.contourf(X3, Y3, werte4, 10)
问题是,比例不一样。通常它应该“相互流动”。我并不是说情节不流畅,我知道我可以通过增加 plt.contourf 函数中的 10 来改变这一点。
是否因为我将情节“划分”为四个区域而出现此问题?