Articles → Matplotlib → Linestyle Attribute In Plot Function In Matplotlib
Linestyle Attribute In Plot Function In Matplotlib
Purpose
Different Line Styles
Character | Description |
---|
- | Solid style |
-- | Dashed style |
-. | Dash dot style |
: | Dotted line style |
Example
import matplotlib.pyplot as plt
import array
arr1 = array.array('i', [1, 2, 3])
arr2 = array.array('i', [4, 5, 6])
plt.plot(arr1,arr2, linestyle="-.")
plt.show()
Output