0
votes

In Matlab:

When plotting in 3d as following:

xxxxx=normrnd(1,1,[1,10000]);
yyyyy=normrnd(1,1,[1,10000]); 
MinX=min(xxxxx); MaxX=max(xxxxx); MinY=min(yyyyy); MaxY=max(yyyyy); 
x = MinX:(MaxX-MinX)/10:MaxX; 
y = MinY:(MaxY-MinY)/10:MaxY; 
[X,Y] = meshgrid(x,y); 
Hist3 = hist3([xxxxx' ,yyyyy'],{x y}); 
figure(); 
surf(X,Y,Hist3); 
colormap(jet); 
shading interp; 

Is it possible to specify a 'transparent' (white?) color for the surface at 'zero' (instead of very dark blue, as seen if you plot the code above)?

Thanks on advance!

1

1 Answers

0
votes

Instead of use the "jet" built-in colormap, you can define your custom colormap which first value will be white (1.0 1.0 1.0 in RGB I think) like in this Matlab page. The example they wrote is

map = [0.2, 0.1, 0.5  % fisrt color
    0.1, 0.5, 0.8
    0.2, 0.7, 0.6
    0.8, 0.7, 0.3
    0.9, 1, 0];  % last color

in which each line is a RGB color. Every value is from 0.0 and 1.0 and not from 0 to 255.