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
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com