MCPcopy Index your code
hub / github.com/plotly/plotly.py / draw_markers

Method draw_markers

plotly/matplotlylib/mplexporter/renderers/base.py:304–339  ·  view source on GitHub ↗

Draw a set of markers. By default, this is done by repeatedly calling draw_path(), but renderers should generally overload this method to provide a more efficient implementation. In matplotlib, markers are created using the plt.plot() command. Parameters

(self, data, coordinates, style, label, mplobj=None)

Source from the content-addressed store, hash-verified

302 )
303
304 def draw_markers(self, data, coordinates, style, label, mplobj=None):
305 """
306 Draw a set of markers. By default, this is done by repeatedly
307 calling draw_path(), but renderers should generally overload
308 this method to provide a more efficient implementation.
309
310 In matplotlib, markers are created using the plt.plot() command.
311
312 Parameters
313 ----------
314 data : array_like
315 A shape (N, 2) array of datapoints.
316 coordinates : string
317 A string code, which should be either 'data' for data coordinates,
318 or 'figure' for figure (pixel) coordinates.
319 style : dictionary
320 a dictionary specifying the appearance of the markers.
321 mplobj : matplotlib object
322 the matplotlib plot element which generated this marker collection
323 """
324 vertices, pathcodes = style["markerpath"]
325 pathstyle = dict(
326 (key, style[key])
327 for key in ["alpha", "edgecolor", "facecolor", "zorder", "edgewidth"]
328 )
329 pathstyle["dasharray"] = "10,0"
330 for vertex in data:
331 self.draw_path(
332 data=vertices,
333 coordinates="points",
334 pathcodes=pathcodes,
335 style=pathstyle,
336 offset=vertex,
337 offset_coordinates=coordinates,
338 mplobj=mplobj,
339 )
340
341 def draw_text(
342 self, text, position, coordinates, style, text_type=None, mplobj=None

Callers 1

draw_marked_lineMethod · 0.95

Calls 1

draw_pathMethod · 0.95

Tested by

no test coverage detected