102102 )
103103)
104104
105- font = {'family' : 'DejaVu Serif ' ,
105+ font = {'family' : 'DejaVu Sans ' ,
106106 'weight' : 'normal' ,
107107 'size' : 9 }
108-
108+
109109plt .rc ('font' , ** font )
110110
111111for i in xrange (len (DATA )):
127127 imax = bisect_right (data_x , x2 )
128128 del data [imin :imax ]
129129
130- data .insert (imin , {'type' : 'dend' , 'x' : x2 , 'y' : y2 , 't' : t2 })
130+ data .insert (imin , {'type' : 'dend' , 'x' : x2 , 'y' : y2 , 't' : t2 })
131131 data .insert (imin , {'type' : 'dbeg' , 'x' : x1 , 'y' : y1 , 't' : t1 })
132132
133133 # make fig
134134 fig = plt .figure (figsize = (200.0 / 72.0 ,200.0 / 72.0 ))
135135 ax = fig .add_subplot (111 )
136-
136+
137137 (xmin ,xmax ,ymin ,ymax ) = lim
138138 ax .set_xlim ((xmin , xmax ))
139139 ax .set_ylim ((ymin , ymax ))
@@ -166,7 +166,7 @@ def d_in_lim(x, y):
166166 # the lines are painted in batches
167167 paint_batch = list ()
168168 for j in xrange (1 , len (data )):
169-
169+
170170 prev_t = data [j - 1 ]['type' ]
171171 curr_t = data [j ]['type' ]
172172 prev_x = data [j - 1 ]['x' ]
@@ -197,7 +197,7 @@ def d_in_lim(x, y):
197197 # we need painting if this is the last data point
198198 if j == len (data ) - 1 :
199199 is_good = False
200-
200+
201201 # paint the current batch, if any
202202 if (not is_good ) and len (paint_batch ) > 1 :
203203
@@ -206,7 +206,7 @@ def compute_dir(n):
206206 (x1 ,y1 ) = paint_batch [n ]
207207 (x2 ,y2 ) = paint_batch [n + 1 ]
208208 return (y2 - y1 )/ (x2 - x1 )
209-
209+
210210 prev_dir = compute_dir (0 )
211211 k = 1
212212 while k < len (paint_batch ) - 1 :
@@ -229,15 +229,15 @@ def compute_dir(n):
229229 curr_t = data [j ]['type' ]
230230 curr_x = data [j ]['x' ]
231231 curr_y = data [j ]['y' ]
232-
232+
233233 # paint point marking discontinuous region if needed
234234 if curr_t != 'c' :
235235 if not d_in_lim (curr_x , curr_y ):
236236 continue
237-
237+
238238 fill = data [j ]['t' ]
239239 l = ax .plot (curr_x , curr_y , marker = 'o' )
240-
240+
241241 plt .setp (l , 'markersize' , 7.5 )
242242 plt .setp (l , 'markeredgewidth' , 0.5 )
243243 plt .setp (l , 'markeredgecolor' , '#0000FF' )
@@ -258,4 +258,4 @@ def compute_dir(n):
258258 os .system ('rm ' + tmpfile )
259259
260260 plt .close ()
261-
261+
0 commit comments