Using plotyy my 2nd Y axis is not depending on X axis when I introduce limits to X axis.
조회 수: 4 (최근 30일)
이전 댓글 표시
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
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Two y-axis에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!