Avoid comparing numpy array to strings in two places #7658

Merged
merged 3 commits into from Dec 22, 2016
@@ -1282,7 +1282,7 @@ def set_aspect(self, aspect, adjustable=None, anchor=None):
etc.
===== =====================
"""
- if aspect in ('equal', 'auto'):
+ if cbook.is_string_like(aspect) and aspect in ('equal', 'auto'):
self._aspect = aspect
else:
self._aspect = float(aspect) # raise ValueError if necessary
View
@@ -840,11 +840,13 @@ def draw(self, renderer):
marker_path = marker.get_path()
marker_trans = marker.get_transform()
w = renderer.points_to_pixels(self._markersize)
- if marker.get_marker() != ',':
+
+ if (is_string_like(marker.get_marker()) and
+ marker.get_marker() == ','):
+ gc.set_linewidth(0)
+ else:
# Don't scale for pixels, and don't stroke them
marker_trans = marker_trans.scale(w)
- else:
- gc.set_linewidth(0)
renderer.draw_markers(gc, marker_path, marker_trans,
subsampled, affine.frozen(),