April 2018
Beginner to intermediate
300 pages
7h 34m
English
Another parameter for tuning is dash_capstyle. It controls the style of the dash ends:
To demonstrate the different cap styles, we have a code snippet of a multiline plots with thick lines to enlarge the dashes:
import matplotlib.pyplot as plt# Prepare 4 data series of sine curvesy = list(range(10))dash_capstyles = ['butt','projecting','round']# Plot each data series in different cap dash stylesfor i,x in enumerate(dash_capstyles): plt.plot([n*(i+1) for n in y],lw=10,ls='--',dash_capstyle=x,label=x)plt.legend(fontsize=16)plt.show()
From the following figure, we can clearly see how blunt and round dashes give different impressions of sharpness and subtlety: ...
Read now
Unlock full access