MCPcopy Create free account
hub / github.com/vispy/vispy / plot

Method plot

vispy/plot/plotwidget.py:281–344  ·  view source on GitHub ↗

Plot a series of data using lines and markers Parameters ---------- data : array | two arrays Arguments can be passed as ``(Y,)``, ``(X, Y)`` or ``np.array((X, Y))``. color : instance of Color Color of the line. symbol : st

(self, data, color='k', symbol=None, line_kind='-', width=1.,
             marker_size=10., edge_color='k', face_color='b', edge_width=1.,
             title=None, xlabel=None, ylabel=None, connect='strip')

Source from the content-addressed store, hash-verified

279 return mesh
280
281 def plot(self, data, color='k', symbol=None, line_kind='-', width=1.,
282 marker_size=10., edge_color='k', face_color='b', edge_width=1.,
283 title=None, xlabel=None, ylabel=None, connect='strip'):
284 """Plot a series of data using lines and markers
285
286 Parameters
287 ----------
288 data : array | two arrays
289 Arguments can be passed as ``(Y,)``, ``(X, Y)`` or
290 ``np.array((X, Y))``.
291 color : instance of Color
292 Color of the line.
293 symbol : str
294 Marker symbol to use.
295 line_kind : str
296 Kind of line to draw. For now, only solid lines (``'-'``)
297 are supported.
298 width : float
299 Line width.
300 marker_size : float
301 Marker size. If `size == 0` markers will not be shown.
302 edge_color : instance of Color
303 Color of the marker edge.
304 face_color : instance of Color
305 Color of the marker face.
306 edge_width : float
307 Edge width of the marker.
308 title : str | None
309 The title string to be displayed above the plot
310 xlabel : str | None
311 The label to display along the bottom axis
312 ylabel : str | None
313 The label to display along the left axis.
314 connect : str | array
315 Determines which vertices are connected by lines.
316
317 Returns
318 -------
319 line : instance of LinePlot
320 The line plot.
321
322 See also
323 --------
324 LinePlot
325 """
326 self._configure_2d()
327 line = scene.LinePlot(data, connect=connect, color=color,
328 symbol=symbol, line_kind=line_kind,
329 width=width, marker_size=marker_size,
330 edge_color=edge_color,
331 face_color=face_color,
332 edge_width=edge_width)
333 self.view.add(line)
334 self.view.camera.set_range()
335 self.visuals.append(line)
336
337 if title is not None:
338 self.title.text = title

Callers 2

test_plot_widget_axesFunction · 0.45
__init__Method · 0.45

Calls 4

_configure_2dMethod · 0.95
set_rangeMethod · 0.80
addMethod · 0.45
appendMethod · 0.45

Tested by 1

test_plot_widget_axesFunction · 0.36