MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / test_marker_as_markerstyle

Function test_marker_as_markerstyle

lib/matplotlib/tests/test_lines.py:274–291  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

272
273
274def test_marker_as_markerstyle():
275 fig, ax = plt.subplots()
276 line, = ax.plot([2, 4, 3], marker=MarkerStyle("D"))
277 fig.canvas.draw()
278 assert line.get_marker() == "D"
279
280 # continue with smoke tests:
281 line.set_marker("s")
282 fig.canvas.draw()
283 line.set_marker(MarkerStyle("o"))
284 fig.canvas.draw()
285 # test Path roundtrip
286 triangle1 = Path._create_closed([[-1, -1], [1, -1], [0, 2]])
287 line2, = ax.plot([1, 3, 2], marker=MarkerStyle(triangle1), ms=22)
288 line3, = ax.plot([0, 2, 1], marker=triangle1, ms=22)
289
290 assert_array_equal(line2.get_marker().vertices, triangle1.vertices)
291 assert_array_equal(line3.get_marker().vertices, triangle1.vertices)
292
293
294@image_comparison(['striped_line.png'], remove_text=True, style='mpl20')

Callers

nothing calls this directly

Calls 7

MarkerStyleClass · 0.90
set_markerMethod · 0.80
_create_closedMethod · 0.80
subplotsMethod · 0.45
plotMethod · 0.45
drawMethod · 0.45
get_markerMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…