Thread Subject: Warning: Patch FaceVertexCData length question...

Subject: Warning: Patch FaceVertexCData length question...

From: Bruce Bowler

Date: 30 Jun, 2009 20:15:47

Message: 1 of 1

The following works for 1 <= n <= 150 and fails for any n>150. What do I
need to do to fix this?

The basic goal is the color any positive value red and any negative value
blue.

function test(n)
xaxisv = 1:n;
anom = random('norm',0,1,1,n);
barH = bar(xaxisv,anom);
barC = get(barH,'Children');
set(barC,'CDataMapping','direct');
mc = [0 0 1;1 0 0];
nv = 1*(anom<0);
pv = 2*(anom>=0);
index = nv+pv;
set(barC,'CData',index);
colormap(mc)

Thanks!
Bruce

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