Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Changing Line Style | Basics: Line Charts
course content

Course Content

Visualization in Python with matplotlib

Changing Line StyleChanging Line Style

Good! More customizing stuff to go!

Additionally, we can customize more line parameters, such as color, line style, points style. These are the simplest, but the .plot() function has many more parameters available to set (you can read about this in the documentation). Let's consider all of the mentioned parameters:

Parameter Python syntax Description
Color color or c Set the color of the line (and points). Possible values for this parameter are in documentation.
Line style linestyle or ls Sets the style of line (for example, dashed or dotted). Possible values for this parameter are in documentation.
Points style marker Sets the marker type (for example, circle or triangle points). Possible values for this parameter are in documentation.

For example, let's modify our example plot even more!

Everything was clear?

Section 1. Chapter 10
course content

Course Content

Visualization in Python with matplotlib

Changing Line StyleChanging Line Style

Good! More customizing stuff to go!

Additionally, we can customize more line parameters, such as color, line style, points style. These are the simplest, but the .plot() function has many more parameters available to set (you can read about this in the documentation). Let's consider all of the mentioned parameters:

Parameter Python syntax Description
Color color or c Set the color of the line (and points). Possible values for this parameter are in documentation.
Line style linestyle or ls Sets the style of line (for example, dashed or dotted). Possible values for this parameter are in documentation.
Points style marker Sets the marker type (for example, circle or triangle points). Possible values for this parameter are in documentation.

For example, let's modify our example plot even more!

Everything was clear?

Section 1. Chapter 10
some-alt