plotting points over contour plot / graph transparency

plotting points over contour plot / graph transparency

Post by Alex » Wed, 24 Sep 2008 23:48:01


i made a plot using pcolor and I want to overlay a second dataset on top of that using stem. when i make the stem plot, however, it has a white background that blocks out the contour plot. Is there a way to either get rid of the white background, or alternatively, to plot on top of a pcolor plot?
thanks
alex
 
 
 

plotting points over contour plot / graph transparency

Post by Walter Rob » Thu, 25 Sep 2008 00:50:09


Which version are you using? Can you give a brief demonstration of the problem?
I do not find the problem to occur in the following example:

z = rand(64,64); X = sort(rand(1,64)); Y = rand(1,64);
pcolor(X,Y,z); hold on; stem(X,Y)

The stem plot is not very readable in this case, but it -is- on top
of the pcolor() plot, and no extra white background is introduced.

Based on your description it almost sounds as if you forgot the
"hold on".

 
 
 

plotting points over contour plot / graph transparency

Post by Alex » Thu, 25 Sep 2008 02:06:02

The example you gave also works for me. I suspect the problem may be that I have 2 sets of axes because I need to have a different y axis scale on the right for the stem plot. So to modify your example:

z = rand(64,64); X = sort(rand(1,64)); Y = rand(1,64);
pcolor(X,Y,z); ax1=gca;ax2=axes('YAxisLocation','Right');hold on; stem(X,Y)