Prev: plot resolution
Next: Selecting Data in Scatter Plot
From: Dinesh Dileep Gaurav on 2 Jul 2010 13:27 Hi all, I want to plot two y-axis data on the same x-axis. The problem is that the first plot should be done using command 'pcolor' and second one using normal 'plot' command. basically this is what I want to do command for first plot is pcolor(x,y1,z);colorbar; command for second plot is plot(x,y2) Here x is x-axis data,y1 and y2 are two different data's against x-axis data. I want it to happen on the same plot. The inbuilt matlab command 'plotyy' doesn't help as it uses 'plot' command for both plots. I also tried the matlab help about 'Multiple Axes on Same figure'. But then what happens , the x-axis data which is same for both axes has different scalings on both cases
From: Steven Lord on 2 Jul 2010 13:40 "Dinesh Dileep Gaurav" <raman_dileep(a)yahoo.co.in> wrote in message news:i0l7h8$cht$1(a)fred.mathworks.com... > Hi all, > I want to plot two y-axis data on the same x-axis. The problem is > that the first plot should be done using command 'pcolor' and second one > using normal 'plot' command. > > basically this is what I want to do > > command for first plot is > > pcolor(x,y1,z);colorbar; > > > command for second plot is > > plot(x,y2) > > Here x is x-axis data,y1 and y2 are two different data's against x-axis > data. > > I want it to happen on the same plot. > > The inbuilt matlab command 'plotyy' doesn't help as it uses 'plot' command > for both plots. Double-check the documentation for PLOTYY -- what do the fifth and sixth input arguments do? -- Steve Lord slord(a)mathworks.com comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ To contact Technical Support use the Contact Us link on http://www.mathworks.com
From: Dinesh Dileep Gaurav on 3 Jul 2010 01:23 > Double-check the documentation for PLOTYY -- what do the fifth and sixth > input arguments do? > > -- > Steve Lord > slord(a)mathworks.com > comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ > To contact Technical Support use the Contact Us link on > http://www.mathworks.com > Thanx for the reply, I checked the documentation for 'plotyy', but it specifies that the functions that can be used are of the form function(x,y). But I want to use 'pcolor' which accepts three arguments.
From: Walter Roberson on 4 Jul 2010 13:38 Dinesh Dileep Gaurav wrote: >> Double-check the documentation for PLOTYY -- what do the fifth and >> sixth input arguments do? > Thanx for the reply, I checked the documentation for 'plotyy', but it > specifies that the functions that can be used are of the form > function(x,y). But I want to use 'pcolor' which accepts three arguments. mypcolor = @(x,y) pcolor(x,y,MyC) then pass mypcolor as the function
From: Dinesh Dileep Gaurav on 2 Aug 2010 10:23
Walter Roberson <roberson(a)hushmail.com> wrote in message <HG3Yn.5817$OU6.721(a)newsfe20.iad>... > Dinesh Dileep Gaurav wrote: > >> Double-check the documentation for PLOTYY -- what do the fifth and > >> sixth input arguments do? > > > Thanx for the reply, I checked the documentation for 'plotyy', but it > > specifies that the functions that can be used are of the form > > function(x,y). But I want to use 'pcolor' which accepts three arguments. > > mypcolor = @(x,y) pcolor(x,y,MyC) > > then pass mypcolor as the function Hello Sir, Sorry for the late reply, I tried the solution you specified recently. I defined the variables as you mentioned. But it results in a error. ??? Error: "mypcolor" was previously used as a variable, conflicting with its use here as the name of a function or command. See MATLAB Programming, "How MATLAB Recognizes Function Calls That Use Command Syntax" for details. |