Hi,
I have concentration values from 6 sources over time, I have plotted these in a single figure as 6 seperate series. I now also want to add the speed values recorded over time to the same graph. Completely different data in a different range, the xdata is the same, so I want to add this information using a secondary y-axis on the right hand side of the figure.
I've found the function plotyy, but that seems to only cope with one series to the left and one to the right. I need 6 to the left and one to the right.
Any help?
Many thanks
|
|
0
|
|
|
|
Reply
|
Jane
|
9/22/2010 7:16:20 PM |
|
On 10-09-22 02:16 PM, Jane wrote:
> I have concentration values from 6 sources over time, I have plotted
> these in a single figure as 6 seperate series. I now also want to add
> the speed values recorded over time to the same graph. Completely
> different data in a different range, the xdata is the same, so I want to
> add this information using a secondary y-axis on the right hand side of
> the figure.
>
> I've found the function plotyy, but that seems to only cope with one
> series to the left and one to the right. I need 6 to the left and one to
> the right.
>
> Any help?
ax = plotyy(... first of 6 for left..., ... desired right side);
hold(ax(1),'on')
now plot the other 5 specifying ax(1) as the axes to plot in to.
If the 6 sources can be aligned to have common X values, perhaps by padding
with NaN in places where one of the sources is shorter, then it becomes
easier: use the 6 different (possibly padded) sources as columns (not rows!)
of a single matrix, and specify that single matrix as the Y matrix; this will
draw all 6 at once, allowing you to use a single plotyy() command for both pieces.
|
|
0
|
|
|
|
Reply
|
Walter
|
9/22/2010 7:31:55 PM
|
|
Perfect!!
Thanks :D
> ax = plotyy(... first of 6 for left..., ... desired right side);
> hold(ax(1),'on')
> now plot the other 5 specifying ax(1) as the axes to plot in to.
>
>
> If the 6 sources can be aligned to have common X values, perhaps by padding
> with NaN in places where one of the sources is shorter, then it becomes
> easier: use the 6 different (possibly padded) sources as columns (not rows!)
> of a single matrix, and specify that single matrix as the Y matrix; this will
> draw all 6 at once, allowing you to use a single plotyy() command for both pieces.
|
|
0
|
|
|
|
Reply
|
Jane
|
9/22/2010 7:50:21 PM
|
|
"Jane T" wrote in message <i7dkm4$g4a$1@fred.mathworks.com>...
> Hi,
>
> I have concentration values from 6 sources over time, I have plotted these in a single figure as 6 seperate series. I now also want to add the speed values recorded over time to the same graph. Completely different data in a different range, the xdata is the same, so I want to add this information using a secondary y-axis on the right hand side of the figure.
>
> I've found the function plotyy, but that seems to only cope with one series to the left and one to the right. I need 6 to the left and one to the right.
>
> Any help?
>
> Many thanks
plotyy(x,[y1;y2;...;y6],x,y7);
|
|
0
|
|
|
|
Reply
|
jimmy.zheng.1982 (1)
|
1/9/2013 4:23:08 PM
|
|
On 1/9/2013 10:23 AM, Jimmy wrote:
> "Jane T" wrote in message <i7dkm4$g4a$1@fred.mathworks.com>...
....
>> I've found the function plotyy, but that seems to only cope with one
>> series to the left and one to the right. I need 6 to the left and one
>> to the right.
>>
....
>
> plotyy(x,[y1;y2;...;y6],x,y7);
And, of course, if the y1 thru y6 aren't of the same length, simply save
the (two) axes handles using the optional return arguments from plotyy
and then add directly to the appropriate axis.
Or, one can augment the shorter yn w/ NaN to the longest length and let
plotyy() deal w/ it automagically since plot() and friends ignore NaN
silently.
--
|
|
0
|
|
|
|
Reply
|
none1568 (6809)
|
1/9/2013 9:59:53 PM
|
|
|
4 Replies
578 Views
(page loaded in 0.048 seconds)
Similiar Articles: Multiple line plots, two y axes - comp.soft-sys.matlab... time2,Vindexyear,'b')" onto the secondary y axis? time=[1958:1:2007]; time2=[1958:1:2005]; figure plot(time ... do not understand why MATLAB could not add a y-axis (ie ... Access 2010 and Charts - comp.databases.ms-access... secondary data and chart type 6) If needed add secondary ... for example) 12) Add title if needed 13) Add axis ... I still can't figure out the formatting problem with ... How to create a second x-axis on top of plot? - comp.soft-sys ...... same spots in the graph), and have both eV and nm scaling show in the figure ... and I would like to plot two ... the x axis; for separation on the y axis, you would add a ... Using 3D Textures - the best way - comp.graphics.api.opengl ...Secondary question... I believe the best technique for ... of have three sets of texture maps, one for each axis ... Learn how to use Blender 3D ... simple way to add ... top 10 uses for random data compression?? anyone? - comp ...Truitt and Leary add Drugs As noted earlier, Jim ... She wants to figure internal signals during Fahd's zone. ... You won't assert me risking opposite your secondary ... Adding a secondary axis to a figure - Newsreader - MATLAB CentralHi, I have concentration values from 6 sources over time, I have plotted these in a single figure as 6 seperate series. I now also want to add the speed values ... Problem using MS directions to add secondary vertical axis ...I am following MS directions to add a secondary axis on a graph in excel 2007. ... And if so, do you think I have to pay to have MS figure it out? Thank you so ... 7/22/2012 9:40:03 AM
|