MATLAB: How to plot to multiple y-axes

axesguimultiple y-axesplot

hi everyone, i'm using GUI and i need to plot some sets of data into the same "axes". I can choose, between these sets of data, w[h]ich one i want to plot.
So, i want to set w[h]ich y-axis (the one on the left or the one on the right) specified data has to use, and i want to use its own scale, for each of them.
How can i "say" to specified data to use (for example) the y-axis on the right? (how can i add this "new" axis to the graph?), and how can i use its own scale?
example:
uiTable = get(handles.uitable,'Data');
x = uiTable(:,1);
y = uiTable(:,19); %this one has to be plotted to the left y-axis with its own scale
...
...
uiTable = get(handles.uitable,'Data');
x = uiTable(:,1);
y2 = uiTable(:,12); %this one has to be plotted to the right y-axis with its own scale

Best Answer

After you've got the data, then
hAx=plotyy(x,y,x,y2); % doc plotyy for details...
Related Question