mpl.pyplot.Line2D.set_linestyle

Line2D.set_linestyle(ls)[source]

Set the linestyle of the line (also accepts drawstyles, e.g., 'steps--')

linestyle description
'-' or 'solid' solid line
'--' or 'dashed' dashed line
'-.' or 'dash_dot' dash-dotted line
':' or 'dotted' dotted line
'None' draw nothing
' ' draw nothing
'' draw nothing

‘steps’ is equivalent to ‘steps-pre’ and is maintained for backward-compatibility.

Alternatively a dash tuple of the following form can be provided:

(offset, onoffseq),

where onoffseq is an even length tuple of on and off ink in points.

ACCEPTS: [‘solid’ | ‘dashed’, ‘dashdot’, ‘dotted’ |
(offset, on-off-dash-seq) | '-' | '--' | '-.' | ':' | 'None' | ' ' | '']

See also

set_drawstyle()
To set the drawing style (stepping) of the plot.
Parameters:

ls : { ‘-‘, ‘–’, ‘-.’, ‘:’} and more see description

The line style.