I want to plot 2D representation of a Gaussian wave function in MATLAB. I want the 2D plot to be in one color (green), which gets transparent away from the center of the Gaussian.
When I use imagesc (like in the next code) I get a Gaussian over a black square (as shown in the figure below).
I do not want the black backgrount, and I want the Gaussian to be in one color, but gets transparent away from the center, so that I won't get the black square, only green circle (over a white background) where the circle gets transparent away from its center.
How can I do that ???
close all;clc
figure
xlim_min=-4;
xlim_max=4;
ylim_min=-4;
ylim_max=4;
ylim([ylim_min ylim_max])
xlim([xlim_min xlim_max])
x=-1:0.001:1;
y=-1:0.001:1;
[X,Y]=meshgrid(x,y);
c1=10;
c1_new=c1*0.3;
x_offset=0;
y_offset=0;
w_function=0.5*0.25*exp(-c1_new*((X+x_offset).^2+...
(Y+y_offset).^2));
imagesc(x,y,w_function);
ylim([ylim_min ylim_max])
xlim([xlim_min xlim_max])


