|
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.
|