Matplotlib: how to set dash in dictionary?

Can someone tell me how to use a custom dash in a dictionary. I can’t achieve this, and the only thing I can’t work with (not a programmer) is the documentation = - (

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 
0
matplotlib
Apr 23 2018-12-12T00:
source share
1 answer

Use the dashes keyword for this (and you need a list instead of a string):

 def lineCycler(): _styles = [{'color':'#b21a6a', 'ls':'-'}, {'color':'#65a4cb', 'dashes':[5,2,10,5]}, {'color':'#22b27c', 'ls':'-.'}, {'color':'k', 'ls':'--'} ] _linecycler=cycle(_styles) return _linecycler 
+2
Apr 23 2018-12-23T00:
source share



All Articles