Enriching plots with colors, markers, and line styles
Colors, markers, and lines styles make charts easier to understand.
The code block that follows plots four different functions and uses the following parameters to modify the appearance:
- The
color=
parameter is used to assign colors. - The
linewidth=
parameter is used to change the width/thickness of the lines. - The
marker=
parameter assigns different shapes to mark the data points. - The
markersize=
parameter changes the size of those markers. - The
alpha=
parameter is used to modify the transparency. - The
drawstyle=
parameter changes the default line connectivity to step connectivity between data points for one plot.
The code is as follows:
fig, (ax1, ax2, ax3, ax4) = plt.subplots(4, ...