From: John H. <jdh...@ac...> - 2005-07-29 14:35:28
|
>>>>> "Steve" == Steve Schmerler <el...@gm...> writes: Steve> Hi Well if you do lineplots Steve> # plot some lines x = [1,2,3] for i in range(...): Steve> plot(x) Steve> mpl changes the color of each line which doesn't happen in Steve> the case of marker plots. Actually something different is going on, but I had to grok through matplotlib.axes._process_plot_var_args to figure it out. The default color cycling happens when there is no string format applied, and is independent of markers and lines. For example, the following does not cycle either for i in range(4): plot(rand(5), rand(5), '-') because a format string is applied. You can make markers cycle too w/o a form string by changing the rc params so that the default makrer is not 'None' rcParams['lines.marker'] = 'o' rcParams['lines.linestyle'] = 'None' for i in range(4): plot(rand(5), rand(5)) Whether or not this is ideal behavior is debatable. But it is probably good enough since it is easy enough to force plot to act like you want by explicitly passing args, as you did. I think Niklas' suggestion of explicitly passing the kwargs for marker, linestyle, color, markerfacecolor and so on is a better approach than constructing arcane format strings. It is more readable and more flexible, because format strings limit you to a small set of colors whereas the kwargs approach supports arbitrary color arguments. JDH |