help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

pcolor and plot graphs transparent


From: Sophia Lianou
Subject: pcolor and plot graphs transparent
Date: Thu, 1 Mar 2012 07:37:04 +0100

Dear Sir/Madam, 

I wonder if you can help me with my code, or to find the appropriate help to resolve my issue. 

I would like to make a color-map, using pcolor, to be plotted on top of another graph, but without the color-map covering the first graph. I can not make the color-map to be "transparent" on top of the first graph. 

I am new in octave, and the plotting is done using gnuplot. Thanks in advance. I append the code I use below. 

Kind regards
Sophia

data1 = load ('eso540_030.pht'); %

x1 = data1(:,1);
y1 = data1(:,2);
mvo1 = data1(:,10);
mio1 = data1(:,19);
col1 = mvo1 - mio1;
%
dcol=0.1;
colbin = 0.3:dcol:1.2; % binning in color
di = 0.1;
ibin = 23.6:di:27.6; % binning in magnitude
%
density = zeros(length(colbin),length(ibin)); % stellar density
%
for i = 1:length (colbin);
for j = 1:length (ibin);
density(i,j) = length(mio1(col1>colbin(i)-dcol/2 & col1<=colbin(i)+dcol/2 & mio1>ibin(j)-di/2 & mio1<=ibin(j)+di/2)) ;
end
end
%
[xx yy]=meshgrid (colbin,ibin);
%
figure(2); clf
plot(col1,mio1, '+', 'Color', [0.65 0.65 0.65], 'MarkerSize',2);
%
hold on
pcolor(xx, yy, density'); % this over-plots and hides some points - can it be transparent?
shading interp;
colormap (flipud(hot))
%
axis([-0.4 2.2 22.2 28.2])
axis square
reply via email to

[Prev in Thread] Current Thread [Next in Thread]