8000 Merge pull request #7658 from dstansby/aspect-array-warning · matplotlib/matplotlib@b8568f9 · GitHub
[go: up one dir, main page]

Skip to content

Commit b8568f9

Browse files
authored
Merge pull request #7658 from dstansby/aspect-array-warning
Avoid comparing numpy array to strings in two places
2 parents 48d50fc + 42786e3 commit b8568f9

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

lib/matplotlib/axes/_base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1282,7 +1282,7 @@ def set_aspect(self, aspect, adjustable=None, anchor=None):
12821282
etc.
12831283
===== =====================
12841284
"""
1285-
if aspect in ('equal', 'auto'):
1285+
if cbook.is_string_like(aspect) and aspect in ('equal', 'auto'):
12861286
self._aspect = aspect
12871287
else:
12881288
self._aspect = float(aspect) # raise ValueError if necessary

lib/matplotlib/lines.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -840,11 +840,13 @@ def draw(self, renderer):
840840
marker_path = marker.get_path()
841841
marker_trans = marker.get_transform()
842842
w = renderer.points_to_pixels(self._markersize)
843-
if marker.get_marker() != ',':
843+
844+
if (is_string_like(marker.get_marker()) and
845+
marker.get_marker() == ','):
846+
gc.set_linewidth(0)
847+
else:
844848
# Don't scale for pixels, and don't stroke them
845849
marker_trans = marker_trans.scale(w)
846-
else:
847-
gc.set_linewidth(0)
848850

849851
renderer.draw_markers(gc, marker_path, marker_trans,
850852
subsampled, affine.frozen(),

0 commit comments

Comments
 (0)
0