@@ -140,12 +140,15 @@ def draw_pathcollection(data, obj):
140
140
141
141
try :
142
142
ec = obj .get_edgecolors ()
143
- except ( TypeError , IndexError ) :
143
+ except TypeError :
144
144
ec = None
145
145
else :
146
- if len (ec ) == 1 :
146
+ if len (ec ) == 0 :
147
+ ec = None
148
+ elif len (ec ) == 1 :
147
149
ec = ec [0 ]
148
150
else :
151
+ print (ec )
149
152
assert len (ec ) == len (dd )
150
153
labels .append ("draw" + 3 * " " )
151
154
ec_strings = [
@@ -154,13 +157,16 @@ def draw_pathcollection(data, obj):
154
157
]
155
158
dd_strings = np .column_stack ([dd_strings , ec_strings ])
156
159
add_individual_color_code = True
160
+ ec = None
157
161
158
162
try :
159
163
fc = obj .get_facecolors ()
160
- except ( TypeError , IndexError ) :
164
+ except TypeError :
161
165
fc = None
162
166
else :
163
- if len (fc ) == 1 :
167
+ if len (fc ) == 0 :
168
+ fc = None
169
+ elif len (fc ) == 1 :
164
170
fc = fc [0 ]
165
171
else :
166
172
assert len (fc ) == len (dd )
@@ -171,6 +177,7 @@ def draw_pathcollection(data, obj):
171
177
]
172
178
dd_strings = np .column_stack ([dd_strings , fc_strings ])
173
179
add_individual_color_code = True
180
+ fc = None
174
181
175
182
try :
176
183
ls = obj .get_linestyle ()[0 ]
@@ -225,14 +232,7 @@ def draw_pathcollection(data, obj):
225
232
draw_options += ["mark options={{{}}}" .format ("," .join (marker_options ))]
226
233
227
234
# `only mark` plots don't need linewidth
228
- data , extra_draw_options = get_draw_options (
229
- data ,
230
- obj ,
231
- None if ec is None or len (ec ) > 1 else ec ,
232
- None if fc is None or len (fc ) > 1 else fc ,
233
- ls ,
234
- None ,
235
- )
235
+ data , extra_draw_options = get_draw_options (data , obj , ec , fc , ls , None )
236
236
draw_options += extra_draw_options
237
237
238
238
if obj .get_cmap ():
@@ -246,6 +246,7 @@ def draw_pathcollection(data, obj):
246
246
for path in obj .get_paths ():
247
247
if is_contour :
248
248
dd = path .vertices
249
+ dd_strings = np .array ([[fmt .format (val ) for val in row ] for row in dd ])
249
250
250
251
if len (obj .get_sizes ()) == len (dd ):
251
252
# See Pgfplots manual, chapter 4.25.
@@ -298,8 +299,7 @@ def get_draw_options(data, obj, ec, fc, ls, lw, hatch=None):
298
299
lw - linewidth
299
300
hatch=None - hatch, i.e., pattern within closed path
300
301
Output:
301
- draw_options - list, to be ",".join(draw_options) to produce the
302
- draw options passed to PGF
302
+ draw_options - list
303
303
"""
304
304
draw_options = []
305
305
0 commit comments