Using plotyy my 2nd Y axis is not depending on X axis when I introduce limits to X axis.
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
I have 2 Y axis (Y1 acceleration and Y2 Velocity), and 1 X axis (time) I am using plotyy to plot 2 curves
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
figure(1)
[ax,hlines(1),hlines(2)] = plotyy(t,Acc,t,Ve);
cfig = get(gcf,'color');
pos = [0.1 0.1 0.7 0.8];
offset = pos(3)/5.5;
xlabel('Time (ms)')
xlim([-80 60])
set(ax(1),'YLim',[-80 50])
set(ax(1),'YTick',[-80:20:50])
set(ax(2),'YLim',[-20 45])
set(ax(2),'YTick',[-20:10:45])
grid on
title('Test 01')
ylabel(ax(1),'Acceleration (g)');
ylabel(ax(2),'velocity (km/h)');
axis on
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
The problem is my Y2 (Velocity) is not fixed with X axis. When i changed X limit "xlim([-80 60])" to "xlim([-80 20])" the Y2 (velocity) plot remains same size. But I need to zoom it in the particular interval.
Please help me.
0 Kommentare
Antworten (0)
Siehe auch
Kategorien
Mehr zu Axis Labels finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!