Chart2D.line#
- Chart2D.line(x, y, color='b', width=1.0, style='-', label='')[source]#
Add a line plot to this chart.
- Parameters:
- xarray_like
X coordinates of the points through which a line should be drawn.
- yarray_like
Y coordinates of the points through which a line should be drawn.
- color
ColorLike, default: “b” Color of the line drawn in this plot. Any color parsable by
pyvista.Coloris allowed.- width
float, default: 1 Width of the line drawn in this plot.
- style
str, default: “-” Style of the line drawn in this plot. See Pen.LINE_STYLES for a list of allowed line styles.
- label
str, default: “” Label of this plot, as shown in the chart’s legend.
- Returns:
plotting.charts.LinePlot2DThe created line plot.
Examples#
Download Python source code | Download Jupyter notebook
Generate a line plot.
>>> import pyvista as pv
>>> chart = pv.Chart2D()
>>> plot = chart.line([0, 1, 2], [2, 1, 3])
>>> chart.show()
Used In#
Docstring Examples
Plotter.remove_chart(2 uses)Renderer.remove_chart(2 uses)Axis.behavior(1 use)Axis.grid(1 use)Axis.grid_pen(1 use)57 more
Axis.label(1 use)Axis.label_size(1 use)Axis.label_visible(1 use)Axis.log_scale(1 use)Axis.margin(1 use)Axis.pen(1 use)Axis.range(1 use)Axis.tick_count(1 use)Axis.tick_label_size(1 use)Axis.tick_labels(1 use)Axis.tick_labels_offset(1 use)Axis.tick_labels_visible(1 use)Axis.tick_locations(1 use)Axis.tick_size(1 use)Axis.ticks_visible(1 use)Axis.toggle(1 use)Axis.visible(1 use)Chart2D(1 use)Chart2D.active_background_color(1 use)Chart2D.active_border_color(1 use)Chart2D.background_color(1 use)Chart2D.background_texture(1 use)Chart2D.border_color(1 use)Chart2D.border_style(1 use)Chart2D.border_width(1 use)Chart2D.grid(1 use)Chart2D.hide_axes(1 use)Chart2D.legend(1 use)Chart2D.legend_visible(1 use)Chart2D.loc(1 use)Chart2D.show(1 use)Chart2D.size(1 use)Chart2D.title(1 use)Chart2D.toggle(1 use)Chart2D.visible(1 use)Chart2D.x_axis(1 use)Chart2D.x_label(1 use)Chart2D.x_range(1 use)Chart2D.y_axis(1 use)Chart2D.y_label(1 use)Chart2D.y_range(1 use)LinePlot2D(1 use)LinePlot2D.brush(1 use)LinePlot2D.color(1 use)LinePlot2D.label(1 use)LinePlot2D.line_style(1 use)LinePlot2D.line_width(1 use)LinePlot2D.pen(1 use)LinePlot2D.toggle(1 use)LinePlot2D.update(1 use)LinePlot2D.visible(1 use)LinePlot2D.x(1 use)LinePlot2D.y(1 use)Pen.color(1 use)Pen.style(1 use)Pen.width(1 use)Renderer.get_charts(1 use)
Gallery Examples