From: Andy on
Well, he had no way of knowing that you had previously used mypcolor as a variable. Did you try changing the name? For example:

pcolorwrapper = @(x,y) pcolor(x,y,MyC)
From: Mirek L on
What about the "hold on"
Is it what you want?

%% Test
x = 1:5;
y1 = x*2;
y2 = x.^2/5+2;

pcolor(x,y1,x'*y1)
hold on
plot(x,y2,'r')
From: Dinesh Dileep Gaurav on
"Andy " <myfakeemailaddress(a)gmail.com> wrote in message <i36krd$4ss$1(a)fred.mathworks.com>...
> Well, he had no way of knowing that you had previously used mypcolor as a variable. Did you try changing the name? For example:
>
> pcolorwrapper = @(x,y) pcolor(x,y,MyC)

Hi thanx for the reply. I don't think using mypcolor earlier was the problem because i never used it before other than the line

mypcolor= @(x,y) pcolor(x,y,MyC)

My wild guess is Matlab is seeing this as a variable assignment rather than a function.
From: Dinesh Dileep Gaurav on
"Mirek L" <miroslawl(a)gmail.com> wrote in message <i36ltg$e6e$1(a)fred.mathworks.com>...
> What about the "hold on"
> Is it what you want?
>
> %% Test
> x = 1:5;
> y1 = x*2;
> y2 = x.^2/5+2;
>
> pcolor(x,y1,x'*y1)
> hold on
> plot(x,y2,'r')


Hi, thanx for the reply. The problem is I want both the plot's y-axes overlapping, so if y1=1:5

and y2=-1:-1:-5 , if you plot using hold on, it comes on top portion and bottom portion of plot. I want them overlapped, using plotyy will do this, left y-axis will be 1:5 and same on right will be -1:-5. But plotyy (for me) is not working with pcolor.
From: Mirek L on
"Dinesh Dileep Gaurav" <dineshdileep(a)gmail.com> wrote in message <i36oc8$s94$1(a)fred.mathworks.com>...
> "Mirek L" <miroslawl(a)gmail.com> wrote in message <i36ltg$e6e$1(a)fred.mathworks.com>...
> > What about the "hold on"
> > Is it what you want?
> >
> > %% Test
> > x = 1:5;
> > y1 = x*2;
> > y2 = x.^2/5+2;
> >
> > pcolor(x,y1,x'*y1)
> > hold on
> > plot(x,y2,'r')
>
>
> Hi, thanx for the reply. The problem is I want both the plot's y-axes overlapping, so if y1=1:5
>
> and y2=-1:-1:-5 , if you plot using hold on, it comes on top portion and bottom portion of plot. I want them overlapped, using plotyy will do this, left y-axis will be 1:5 and same on right will be -1:-5. But plotyy (for me) is not working with pcolor.


'hold on' rulez? ;)


%% Test
x = 1:5;
y1 = x;
y2 = -x;

figure
pcolor(x,y1,x'*y1)
hold on
[AX,H1,H2] = plotyy(x,y1,x,y2)
set(H2,'LineStyle','none')
set(H1,'LineWidth',3)
set(H1,'Color','r')
First  |  Prev  | 
Pages: 1 2
Prev: plot resolution
Next: Selecting Data in Scatter Plot