@@ -206,7 +206,7 @@ def draw_regpoly_collection(
206206
207207
208208 def draw_line_collection (self , segments , transform , clipbox ,
209- colors , linewidths , linestyles , antialiaseds ,
209+ colors , linewidths , linestyle , antialiaseds ,
210210 offsets , transOffset ):
211211 """
212212 This is a function for optimized line drawing. If you need to
@@ -229,7 +229,7 @@ def draw_line_collection(self, segments, transform, clipbox,
229229
230230 linewidths is a tuple of linewidths
231231
232- linestyles is a tuple of (offset, onoffseq) tuples
232+ linestyle is an (offset, onoffseq) tuple or None,None for solid
233233
234234 antialiseds is a tuple of ones or zeros indicating whether the
235235 segment should be aa or not
@@ -249,7 +249,7 @@ def draw_line_collection(self, segments, transform, clipbox,
249249 i = 0
250250 Nc = len (colors )
251251 Nlw = len (linewidths )
252- Nls = len ( linestyles )
252+
253253 Naa = len (antialiaseds )
254254
255255 usingOffsets = offsets is not None
@@ -262,6 +262,9 @@ def draw_line_collection(self, segments, transform, clipbox,
262262
263263 gc .set_clip_rectangle (clipbox .get_bounds ())
264264
265+ if linestyle [0 ] is not None :
266+ offset , seq = linestyle
267+ gc .set_dashes ( offset , seq )
265268
266269 for i in xrange (N ):
267270 x , y = zip (* segments [i % Nsegments ])
@@ -274,9 +277,7 @@ def draw_line_collection(self, segments, transform, clipbox,
274277 gc .set_foreground ( rgb , isRGB = True )
275278 gc .set_alpha ( alpha )
276279 gc .set_linewidth ( linewidths [i % Nlw ] )
277-
278- offset , seq = linestyles [i % Nls ]
279- gc .set_dashes ( offset , seq )
280+
280281 gc .set_antialiased ( antialiaseds [i % Naa ] )
281282 if usingOffsets :
282283 xo , yo = transOffset .xy_tup (offsets [i % Noffsets ])
0 commit comments