Whenever, I want to plot multiple 2d line graphs graphs with matplotlib, I define two lists :
coloTypesList=["b","g","r","c","m","y","k"];
drawTypesList=["-","--","x"];
and select a pair from these at each iteration(for each graph). This is method only helps me when I have less than 22 graphs to draw. Any idea about making this more general with the coloring and the drawing-type?
From the lists you give you have 21 combinations:
However there are many more options than those you currently use:
Line style or marker:
Color abbreviations:
Note that you can specify colors as RGB or RGBA tuples (
(0, 1, 0, 1)) so you can create a full palette. Just adding light/dark versions of your current colors you are multiplying your possibilities.I’m not sure you need so many combinations of markers and colors in one only plot. Given you use only the standard colors, you have a maximum of 26 * 8 = 208 combinations (well, white should not be taken into account…).