pyvista.plotting.charts.Pen#

class Pen(color='k', width=1, style='-', *, _wrap=None)[source]#

Pythonic wrapper for a VTK Pen, used to draw lines.

Parameters
colorcolor_like, optional

Color of the lines drawn using this pen. Any color parsable by pyvista.Color is allowed. Defaults to "k".

widthfloat, optional

Width of the lines drawn using this pen. Defaults to 1.

stylestr, optional

Style of the lines drawn using this pen. See Pen.LINE_STYLES for a list of allowed line styles. Defaults to "-".

Other Parameters
_wrapvtk.vtkPen, optional

Wrap an existing VTK Pen instance. Defaults to None (no wrapping).

Notes

LINE_STYLESdict

Dictionary containing all allowed line styles as its keys.

Line styles#

Style

Description

Example

""

Hidden

../../../../_images/ls_0.png

"-"

Solid

../../../../_images/ls_1.png

"--"

Dashed

../../../../_images/ls_2.png

":"

Dotted

../../../../_images/ls_3.png

"-."

Dash-dot

../../../../_images/ls_4.png

"-.."

Dash-dot-dot

../../../../_images/ls_5.png

Methods

Attributes

Pen.color

Return or set the pen's color.

Pen.style

Return or set the pen's line style.

Pen.width

Return or set the pen's width.