Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 5b2ad5d

Browse filesBrowse files
committed
TST: add test for error
1 parent 2587052 commit 5b2ad5d
Copy full SHA for 5b2ad5d

File tree

Expand file treeCollapse file tree

2 files changed

+11
-1
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+11
-1
lines changed

‎lib/matplotlib/lines.py

Copy file name to clipboardExpand all lines: lib/matplotlib/lines.py
+4-1Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,10 @@ def __init__(self, xdata, ydata,
370370
self.set_color(color)
371371
if marker is None:
372372
marker = 'none' # Default.
373-
self._marker = MarkerStyle(marker, fillstyle)
373+
if not isinstance(marker, MarkerStyle):
374+
self._marker = MarkerStyle(marker, fillstyle)
375+
else:
376+
self._marker = marker
374377

375378
self._markevery = None
376379
self._markersize = None

‎lib/matplotlib/tests/test_axes.py

Copy file name to clipboardExpand all lines: lib/matplotlib/tests/test_axes.py
+7Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4906,6 +4906,13 @@ def test_shared_with_aspect_3():
49064906
assert round(expected, 4) == round(ax.get_aspect(), 4)
49074907

49084908

4909+
def test_shared_aspect_error():
4910+
fig, axes = plt.subplots(1, 2, sharex=True, sharey=True)
4911+
axes[0].axis("equal")
4912+
with pytest.raises(RuntimeError, match=r"set_aspect\(..., adjustable="):
4913+
fig.draw_without_rendering()
4914+
4915+
49094916
@pytest.mark.parametrize('twin', ('x', 'y'))
49104917
def test_twin_with_aspect(twin):
49114918
fig, ax = plt.subplots()

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.