[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: different colours for different curves in the same plot

From: Moo
Subject: Re: different colours for different curves in the same plot
Date: Thu, 2 Jun 2011 00:15:18 -0600

On Tue, May 31, 2011 at 9:59 AM, Federica <address@hidden> wrote:

I'm trying to represent several curves on the same plot using Octave 3.2.4
on Windows. The commands I used to have the unique plot and a relative
legend are:

hold on;
  s=sprintf(";Lu= %d;",LU);

hold off

where m is the result of a differential equation systems. So I have
different curves for different m but using these commands I have only a
colour for all the curves. Also if I specify the color I have only the
specific color I chose and I have it for all the curves. How can I tell to
Octave to pick a different color for each curve?

Thank you so much!!!!


I haven't looked very carefully at the previous suggestions, other than that they are all using loops.  I believe that is the best you can do if you want to specify colors.  If you don't care what the colors are for your plots, assuming you have x_data of size 1xN and y_data size MxN, where M is the number of solutions/whatever, you should be able to do


and Octave will automatically plot each solution separately in different colors.  I don't know how many colors it cycles through or the criteria for the colors chosen, but I thought I should point that out.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]