반응형
Notice
Recent Posts
Recent Comments
Link
관리 메뉴

bro's coding

matplotlib.contourf(등고선 그리기 2) 본문

[IT]/python.matplotlib

matplotlib.contourf(등고선 그리기 2)

givemebro 2020. 4. 3. 00:11
반응형
import numpy as np
import matplotlib.pyplot as plt

 

 

x=np.arange(-1,1,0.1)
y=np.arange(-1,1,0.1)

X,Y=np.meshgrid(x,y)
Z=np.exp(-(X**2+Y**2))

CS=plt.contourf(X,Y,Z,levels=np.arange(-1,1,0.05),alpha=0.5,cmap='seismic')

plt.colorbar()

 

 

CS=plt.contour(X,Y,Z,levels=np.arange(-1,1,0.05))
plt.clabel(CS,inline=2,fontsize=10)

https://broscoding.tistory.com/81

 

matplotlib.contour(등고선 그리기 1)

import numpy as np import matplotlib.pyplot as plt # x,y의 구간 설정 x=np.arange(-1,1,0.1) y=np.arange(-1,1,0.1) # x,y에 대한 관계좌표 설정 X,Y=np.meshgrid(x,y) # X,Y에 관한 Z값 설정 Z=np.sin(X*Y) #..

broscoding.tistory.com

 

반응형
Comments