Thread Subject:
longer colormaps

Subject: longer colormaps

From: nanren888

Date: 17 Jun, 2010 09:20:23

Message: 1 of 3

I was trying larger colormaps.

len = 64;
im = [0:(len-1);(len-1):-1:0]; % ramp up & ramp down
figure(1);
image(im);
cm = hsv(len);
colormap(cm);
colorbar();
figure(2); plot(cm); colormap(cm);

Pretty much as I expect. A couple of ramps with a colorbar. figure(2) shows the correct colormap.

len = 164;im = [0:(len-1);(len-1):-1:0];figure(1);image(im);cm = hsv(len);colormap(cm);colorbar();figure(2);plot(cm);colormap(cm);

Same

len = 264;im = [0:(len-1);(len-1):-1:0];figure(1);image(im);cm = hsv(len);colormap(cm);colorbar();figure(2);plot(cm);colormap(cm);

Now a black bar appears at the top.

len = 1264; ...

The whole graph goes black.
figure(2) still shows correct colormap values, but not the image nor the colorbar.

Mapping is default 'direct'. Image content is double.

Seems that something about 'direct' access of colormaps in images wraps at 255.
Anyone explain it to me?
Thanks, in advance.

Subject: longer colormaps

From: us

Date: 17 Jun, 2010 09:46:04

Message: 2 of 3

"nanren888 " <nanren888.remove.this@hotmail.com> wrote in message <hvcpcm$7db$1@fred.mathworks.com>...
> I was trying larger colormaps.
>
> len = 64;
> im = [0:(len-1);(len-1):-1:0]; % ramp up & ramp down
> figure(1);
> image(im);
> cm = hsv(len);
> colormap(cm);
> colorbar();
> figure(2); plot(cm); colormap(cm);
>
> Pretty much as I expect. A couple of ramps with a colorbar. figure(2) shows the correct colormap.
>
> len = 164;im = [0:(len-1);(len-1):-1:0];figure(1);image(im);cm = hsv(len);colormap(cm);colorbar();figure(2);plot(cm);colormap(cm);
>
> Same
>
> len = 264;im = [0:(len-1);(len-1):-1:0];figure(1);image(im);cm = hsv(len);colormap(cm);colorbar();figure(2);plot(cm);colormap(cm);
>
> Now a black bar appears at the top.
>
> len = 1264; ...
>
> The whole graph goes black.
> figure(2) still shows correct colormap values, but not the image nor the colorbar.
>
> Mapping is default 'direct'. Image content is double.
>
> Seems that something about 'direct' access of colormaps in images wraps at 255.
> Anyone explain it to me?
> Thanks, in advance.

the problem is hw related...

one of the solutions

     figure;
     colormap(hsv(1024));
     colorbar;
     disp('all red - cont with any key');
     pause;
     set(gcf,'renderer','opengl');
% full cmap...

us

Subject: longer colormaps

From: nanren888

Date: 17 Jun, 2010 09:56:03

Message: 3 of 3

us, thanks for the fix. Works a treat.

Sorry, exactly what is broken?

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
colorbar us 17 Jun, 2010 05:49:06
code us 17 Jun, 2010 05:49:06
colormap us 17 Jun, 2010 05:49:06
image colormap wra... nanren888 17 Jun, 2010 05:24:06
rssFeed for this Thread

Contact us