2012-04-23 4 views
0

누구나 사전에 맞춤 대시 시퀀스를 사용하는 방법을 알려줄 수 있습니까? 나는 = 그 실행 내가 (안 프로그래머)와 함께 작동하지 않을 수있는 유일한 일이 문서는 얻을 수 없다 - (Matplotlib : 사전에 대시를 설정하는 방법?

def lineCycler(): #must be invoked for every plot again to get the same results in every plot 
    #hasy="#7b9aae" 
    _styles = [{'color':'#b21a6a', 'ls':'-'}, 
       {'color':'#65a4cb', 'ls':'[5,2,10,5]'},# this shoul be some custom dash sequnece 
       {'color':'#22b27c', 'ls':'-.'}, 
       {'color':'k', 'ls':'--'} 
      ] 

    _linecycler=cycle(_styles) 
    return _linecycler 
그것에 대해

답변

2

사용 dashes 키워드 (당신이 대신 문자열, 목록이 필요) :

def lineCycler(): 
    _styles = [{'color':'#b21a6a', 'ls':'-'}, 
       {'color':'#65a4cb', 'dashes':[5,2,10,5]}, 
       {'color':'#22b27c', 'ls':'-.'}, 
       {'color':'k', 'ls':'--'} 
      ] 

    _linecycler=cycle(_styles) 
    return _linecycler 
+0

대단히 감사합니다. (펠트처럼) 백만 가지 설정을 테스트했지만이 내용이 누락되었습니다. –

관련 문제