Thread Subject: How to generate ROYGBIV Nx3 colormap automatically

Subject: How to generate ROYGBIV Nx3 colormap automatically

From: giordano.sagredo@gmail.com

Date: 27 May, 2009 18:13:42

Message: 1 of 3

I have an Nx10 matrix, and want to plot each row on the same plot, but so that row 1 is red, row N is violet or whatever (that is, each row is a different color, but traversing logically through colorspace).

In other words, the first 'color' for plot will be [1 0 0], and the Nth will be blue/purple.

Is there a function that generates the Nx3 color matrix for this automatically?

Subject: How to generate ROYGBIV Nx3 colormap automatically

From: Alan B

Date: 27 May, 2009 20:15:03

Message: 2 of 3

"giordano.sagredo@gmail.com" <giordano.sagredo@gmail.com> wrote in message <15877568.3569.1243448053135.JavaMail.jakarta@nitrogen.mathforum.org>...
> I have an Nx10 matrix, and want to plot each row on the same plot, but so that row 1 is red, row N is violet or whatever (that is, each row is a different color, but traversing logically through colorspace).
>
> In other words, the first 'color' for plot will be [1 0 0], and the Nth will be blue/purple.
>
> Is there a function that generates the Nx3 color matrix for this automatically?

The hsv colormap function should work:
hsv(N)

Subject: How to generate ROYGBIV Nx3 colormap automatically

From: giordano.sagredo@gmail.com

Date: 28 May, 2009 14:47:05

Message: 3 of 3

hsv(N) is perfect

Many thanks that's it!

Tags for this Thread

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

rssFeed for this Thread

Contact us at files@mathworks.com