The following tables describe the codes for Marker, line styles and colours.
Color |
Code |
Black |
'k' |
Blue |
'b' |
Green |
'g' |
Red |
'r' |
White |
'w' |
Line Style |
Code |
Solid |
'-' |
Dashed |
'--' |
Dash Dot |
'-.' |
Dotted |
':' |
No Line |
'', ' ' or None |
Marker |
Code |
Circle |
o |
Diamond |
D |
Point |
. |
Plus |
+ |
Square |
s |
Star |
* |
Up Triangle |
^ |
X |
x |
A list of line properties is available here.
- Change your program to plot a red dotted line with stars. Input the linestyle, color and marker separately
- Try the same but inputting all the line properties in one string
- Change it again to plot a blue solid line with no marker