2013-01-10 4 views
4

단순한 등고선을 만들고 있는데 두껍게 만들고 색을 변경하여 제로 선을 강조하고 싶습니다.단일 등고선 강조 표시

cs = ax1.contour(x,y,obscc) 
ax1.clabel(cs,inline=1,fontsize=8,fmt='%3.1f') 

어떻게해야합니까?

답변

5

HTH :-) 감사합니다 -이 방금 수정 레벨 라인

contour -method에서 반환되는 개체로, 기본적으로 matplotlib docs에서 가져온 윤곽의 예이다는 참조를 보유하고 collections 속성의 등고선에 연결합니다. 등고선은 일반적인 LineCollections입니다. 다음 코드에서

는 윤곽 플롯에 대한 참조가 코드에서 CS (즉, 귀하의 질문에 cs입니다) : 여기

CS.collections[0].set_linewidth(4)   # the dark blue line 
CS.collections[2].set_linewidth(5)   # the cyan line, zero level 
CS.collections[2].set_linestyle('dashed') 
CS.collections[3].set_linewidth(7)   # the red line 
CS.collections[3].set_color('red') 
CS.collections[3].set_linestyle('dotted') 

type(CS.collections[0]) 
# matplotlib.collections.LineCollection 

명시 적으로 지정하지 않은 경우, 수준에 대해 알아 찾는 방법 그들 :

CS.labelCValueList CS.labelIndiceList CS.labelTextsList 
CS.labelCValues  CS.labelLevelList  CS.labelXYs 
CS.labelFmt   CS.labelManual  CS.labels 
CS.labelFontProps  CS.labelMappable  CS.layers 
CS.labelFontSizeList CS.labelTexts 
: 개별 라벨을 포맷하는 많은 기능이있다

CS.levels 
array([-1. , -0.5, 0. , 0.5, 1. , 1.5]) 

+0

고마워 :-) 잘 할 것입니다. – Shejo284