Thread Subject: colored markers in plot; cycling though colors

Subject: colored markers in plot; cycling though colors

From: Godzilla

Date: 5 Feb, 2009 02:55:03

Message: 1 of 2

I'm adding points from different experiments to a plot and I would like to color them differently for each experiment. The problem is that the number of experiments varies. Therefore I need to make a color table that has n different colors, where n is the number of experiments. I realize that I can assign a color in a plot by using, e,.g:
plot( ...,'markerfacecolor',[a b c])

and my question is how do I vary a,b,c so that I get a (rainbow) spectrum of colors.

I tried:

for i=1:n
plot( [data from experiment], markerfacecolor',[1 1 1]/i)

and this resulted in shades of gray, which is difficult to view if there are more than 3-4 experiments.

Subject: colored markers in plot; cycling though colors

From: Matt Fig

Date: 5 Feb, 2009 04:40:18

Message: 2 of 2

Why not use the colormap?

T = colormap;




`krrf_%_m>_%m}mlregitmw`}mj8c_f}}}cm_lcj}WgcKCa}nfk}n_ss,_a

Tags for this Thread

Everyone's Tags:

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.

Tag Activity for This Thread
Tag Applied By Date/Time
plot Godzilla 4 Feb, 2009 22:00:07
markers Godzilla 4 Feb, 2009 22:00:07
color Godzilla 4 Feb, 2009 22:00:06
rssFeed for this Thread

Contact us at files@mathworks.com