Thread Subject: alpha value and colormaps

Subject: alpha value and colormaps

From: Affan

Date: 16 Nov, 2009 17:11:18

Message: 1 of 1

I am trying to plot the same data set as an image with two different
colormaps (the second is to show the result of a thresholding
function). my MAP variable in the code below is a 2 D matrix showing
confidence/probability (so from 0-1).

ax= subplot(1,loopEnd-loopStart,fileIndex);
 ibg1=imagesc(MAP);
 %set(ibg1,'AlphaData',0.8);;
axis xy;
m=colormap(flipud(gray));
hold on;


ibg2=imagesc(MAP);
set(ibg2,'AlphaData',0.3);
 axis xy;
 % The following section is used to do threholding
 thresholdValue = 0.45;
thresholdRow = round(thresholdValue * 256)
cmap = [ones(thresholdRow,3); ones((256-thresholdRow),3)*0.5]
colormap(cmap)

However, debugging at the point when I imagesc the second time, I
loose both figures, and it appears that the colormap is applied to
both images. What is the solution?

Note that when I try the matlab FAQ to superimpose two figure at
http://www.mathworks.com/support/solutions/en/data/1-1AK7N/index.html
applying colormap at the superposition point has no affect. I am not
clear about the internals of matlab but any help would be appreciated.

Affan

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