matplotlib에서 plot_surface를 사용하여 3D 표면을 플로트 해 보았습니다. 내 코드는 다음과 같습니다python plot_surface에서 X 축과 Y 축과 동일한 Z 축척을 설정하는 방법
fig = plt.figure()
ax = fig.gca(projection='3d')
# ax.set_aspect('equal')
ax.plot_surface(X, Y, H4200, rstride=1000, cstride=1000)
ax.set_xlabel('X Label')
ax.set_ylabel('Y Label')
ax.set_zlabel('Z Label')
# ax._autoscaleXon = True
# ax._autoscaleYon = True
# ax._autoscaleZon = True
# ax.set_aspect('equal', adjustable='box')
plt.show()
음모의 결과는 다음과 같습니다
1 :
2 : Z의
분명히 길이 단위가 X의 단위와 동일하지 않습니다. Y 축.
제 질문은 X 축의 축척과 같은 Z 축의 축척을 설정하는 방법입니까?
내 의견에 표시된대로 ax.set_aspect('equal'), ax._autoscaleXon = True, ax._autoscaleYon = True, ax._autoscaleZon = True, ax.set_aspect('equal', adjustable='box')
을 시도했지만 작동하지 않습니다. 어떻게이 질문을 해결할 수 있습니까? 도와 줘서 고마워!
시도해 보았지만 여전히 작동하지 않습니다. – yogazining
@yogazining 제 편집 된 답변을 참조하십시오. – swatchai
대단히 고마워요, 당신의 솔루션을 구현했고 작동합니다! 큰!! – yogazining