Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Overlay pcolor on to grayscale image

400 views
Skip to first unread message

M P

unread,
Jun 19, 2008, 11:07:01 AM6/19/08
to
Hello

I was wondering if there is a way in MATLAB to make a
pcolor plot transparent and overlay it ontop of a grayscale
image.

Any help would be appreciated.
Thanks.

Walter Roberson

unread,
Jun 19, 2008, 12:22:55 PM6/19/08
to
In article <g3dsml$4no$1...@fred.mathworks.com>, M P <mel_...@yahoo.com> wrote:

>I was wondering if there is a way in MATLAB to make a
>pcolor plot transparent and overlay it ontop of a grayscale
>image.

See the alpha() routine. You can make images, patches, and
surfaces transparent.
--
"Tired minds don't plan well. Sleep first, plan later."
-- Walter Reisch

M P

unread,
Jun 19, 2008, 1:39:02 PM6/19/08
to
Hello

Thank you for the suggestion on the alpha function.
Although this function makes the pcolor graph more
transparent, it disappears once I call imshow() or
subimage(). Unfortunately I still can't figure out how to
overlay a 'pcolor' graph onto a grayscale .tif image, or if
this is possible in MATLAB.

Any help is appreciated.

robe...@ibd.nrc-cnrc.gc.ca (Walter Roberson) wrote in
message <g3e14v$pk0$1...@canopus.cc.umanitoba.ca>...

Rik-Jan Lemmen

unread,
Jul 7, 2008, 10:43:31 AM7/7/08
to
I did it as follows:

figure(2)
set(figure(2),'color','white')
imagesc(imageshow)
axis off
hold on


X_plot = X_strain_y_comb ;
Y_plot = Y_strain_y_comb ;
Z_plot = strain_y_comb ;
min_bar = 0;
max_bar = 0.007 ;
caxis([min_bar max_bar]) ;
h_plot = pcolor( X_plot, Y_plot, Z_plot)
colorbar('location','eastoutside')
set(h_plot,'facecolor', 'interp', 'FaceAlpha',0.4) ;
set
(h_plot, 'lineStyle' , 'none','marker' , '.','markerSize' ,
1 ) ;

in which imageshow a image was and the X-Y-Z plot the data
was which I want to overlay over the image

"M P" <mel_...@yahoo.com> wrote in message
<g3e5jm$f8u$1...@fred.mathworks.com>...

Rik-Jan Lemmen

unread,
Jul 7, 2008, 10:46:05 AM7/7/08
to
I did it as follows:

figure(2)
set(figure(2),'color','white')
imagesc(imageshow)
axis off
hold on


X_plot = X_strain_y_comb ;
Y_plot = Y_strain_y_comb ;
Z_plot = strain_y_comb ;
min_bar = 0;
max_bar = 0.007 ;
caxis([min_bar max_bar]) ;
h_plot = pcolor( X_plot, Y_plot, Z_plot)
colorbar('location','eastoutside')
set(h_plot,'facecolor', 'interp', 'FaceAlpha',0.4) ;
set
(h_plot, 'lineStyle' , 'none','marker' , '.','markerSize' ,
1 ) ;

in which imageshow a image was and the X-Y-Z plot the data
was which I want to overlay over the image

"M P" <mel_...@yahoo.com> wrote in message
<g3e5jm$f8u$1...@fred.mathworks.com>...

Rik-Jan Lemmen

unread,
Jul 7, 2008, 10:47:12 AM7/7/08
to
I did it as follows:

figure(2)
set(figure(2),'color','white')
imagesc(imageshow)
axis off
hold on


X_plot = X_strain_y_comb ;
Y_plot = Y_strain_y_comb ;
Z_plot = strain_y_comb ;
min_bar = 0;
max_bar = 0.007 ;
caxis([min_bar max_bar]) ;
h_plot = pcolor( X_plot, Y_plot, Z_plot)
colorbar('location','eastoutside')
set(h_plot,'facecolor', 'interp', 'FaceAlpha',0.4) ;
set
(h_plot, 'lineStyle' , 'none','marker' , '.','markerSize' ,
1 ) ;

in which imageshow a image was and the X-Y-Z plot the data
was which I want to overlay over the image

"M P" <mel_...@yahoo.com> wrote in message
<g3e5jm$f8u$1...@fred.mathworks.com>...

Rik-Jan Lemmen

unread,
Jul 7, 2008, 10:47:12 AM7/7/08
to
I did it as follows:

figure(2)
set(figure(2),'color','white')
imagesc(imageshow)
axis off
hold on


X_plot = X_strain_y_comb ;
Y_plot = Y_strain_y_comb ;
Z_plot = strain_y_comb ;
min_bar = 0;
max_bar = 0.007 ;
caxis([min_bar max_bar]) ;
h_plot = pcolor( X_plot, Y_plot, Z_plot)
colorbar('location','eastoutside')
set(h_plot,'facecolor', 'interp', 'FaceAlpha',0.4) ;
set
(h_plot, 'lineStyle' , 'none','marker' , '.','markerSize' ,
1 ) ;

in which imageshow a image was and the X-Y-Z plot the data
was which I want to overlay over the image

"M P" <mel_...@yahoo.com> wrote in message
<g3e5jm$f8u$1...@fred.mathworks.com>...

Rik-Jan Lemmen

unread,
Jul 7, 2008, 10:49:55 AM7/7/08
to
I did it as follows:

figure(2)
set(figure(2),'color','white')
imagesc(imageshow)
axis off
hold on


X_plot = X_strain_y_comb ;
Y_plot = Y_strain_y_comb ;
Z_plot = strain_y_comb ;
min_bar = 0;
max_bar = 0.007 ;
caxis([min_bar max_bar]) ;
h_plot = pcolor( X_plot, Y_plot, Z_plot)
colorbar('location','eastoutside')
set(h_plot,'facecolor', 'interp', 'FaceAlpha',0.4) ;
set
(h_plot, 'lineStyle' , 'none','marker' , '.','markerSize' ,
1 ) ;

in which imageshow a image was and the X-Y-Z plot the data
was which I want to overlay over the image

"M P" <mel_...@yahoo.com> wrote in message
<g3e5jm$f8u$1...@fred.mathworks.com>...

Rik-Jan Lemmen

unread,
Jul 7, 2008, 10:50:25 AM7/7/08
to
I did it as follows:

figure(2)
set(figure(2),'color','white')
imagesc(imageshow)
axis off
hold on


X_plot = X_strain_y_comb ;
Y_plot = Y_strain_y_comb ;
Z_plot = strain_y_comb ;
min_bar = 0;
max_bar = 0.007 ;
caxis([min_bar max_bar]) ;
h_plot = pcolor( X_plot, Y_plot, Z_plot)
colorbar('location','eastoutside')
set(h_plot,'facecolor', 'interp', 'FaceAlpha',0.4) ;
set
(h_plot, 'lineStyle' , 'none','marker' , '.','markerSize' ,
1 ) ;

in which imageshow a image was and the X-Y-Z plot the data
was which I want to overlay over the image

"M P" <mel_...@yahoo.com> wrote in message
<g3e5jm$f8u$1...@fred.mathworks.com>...

Rik-Jan Lemmen

unread,
Jul 7, 2008, 10:51:00 AM7/7/08
to
I did it as follows:

figure(2)
set(figure(2),'color','white')
imagesc(imageshow)
axis off
hold on


X_plot = X_strain_y_comb ;
Y_plot = Y_strain_y_comb ;
Z_plot = strain_y_comb ;
min_bar = 0;
max_bar = 0.007 ;
caxis([min_bar max_bar]) ;
h_plot = pcolor( X_plot, Y_plot, Z_plot)
colorbar('location','eastoutside')
set(h_plot,'facecolor', 'interp', 'FaceAlpha',0.4) ;
set
(h_plot, 'lineStyle' , 'none','marker' , '.','markerSize' ,
1 ) ;

in which imageshow a image was and the X-Y-Z plot the data
was which I want to overlay over the image

"M P" <mel_...@yahoo.com> wrote in message
<g3e5jm$f8u$1...@fred.mathworks.com>...

Rik-Jan Lemmen

unread,
Jul 7, 2008, 10:52:52 AM7/7/08
to
I did it as follows:

figure(2)
set(figure(2),'color','white')
imagesc(imageshow)
axis off
hold on


X_plot = X_strain_y_comb ;
Y_plot = Y_strain_y_comb ;
Z_plot = strain_y_comb ;
min_bar = 0;
max_bar = 0.007 ;
caxis([min_bar max_bar]) ;
h_plot = pcolor( X_plot, Y_plot, Z_plot)
colorbar('location','eastoutside')
set(h_plot,'facecolor', 'interp', 'FaceAlpha',0.4) ;
set
(h_plot, 'lineStyle' , 'none','marker' , '.','markerSize' ,
1 ) ;

in which imageshow a image was and the X-Y-Z plot the data
was which I want to overlay over the image

"M P" <mel_...@yahoo.com> wrote in message
<g3e5jm$f8u$1...@fred.mathworks.com>...

0 new messages