creating a multi colored graph with respect to the values in y-axis

Wanderer wanderer at dialup4less.com
Wed Jun 15 11:32:34 EDT 2011


On Jun 15, 11:04 am, Ravikanth <vvnrk.vanapa... at gmail.com> wrote:
> Hi all,
>
> I am a beginner in python. I need to implement a graph with multiple
> colors in it.
> In a way, I have a function which varies with respect to time and
> amplitude. I have time on x-axis and amplitude on y-axis. Lets say the
> amplitude of the graph is divided into 4 ranges, say 1-3,3-5,5-9,
> 10-3. I need to plot the graph in such a way that, when the values of
> amplitude are in a particular range say 1-3, the color of graph should
> be red.
> If the amplitude is in the range from 3-5 the graph need to be in
> color blue etc..,
>
> Can somebody guide me on this, how to achive this functionality.
>
> Regards,
> Ravikanth

Check out the examples in matplotlib.

http://matplotlib.sourceforge.net/examples/pylab_examples/multicolored_line.html



More information about the Python-list mailing list