08 matlab double Y axes plot

preview_player
Показать описание
a systematical matlab plotting tutorial - 08/12 double Y axes plot
----- template -----
%% Double Y axis plot
figure(1);clf; clear

x = 0:0.01:40;
y1 = 200*exp(-0.05*x).*sin(x);
y2 = 0.8*exp(-0.5*x).*sin(10*x);
[AX,H1,H2] = plotyy(x,y1,x,y2); %[axes handle, line1 h, line2 h]

set(...
get(AX(1),'Ylabel'),...
'String', 'Slow Decay',...
'Fontsize',15 ...
)
set(get(AX(2),'Ylabel'),'String','Fast Decay','Fontsize',15)

set(AX(1),'Xlim',[-2 30])
set(AX(2),'Xlim',[-2 30])

get(AX(1))
get(AX(1),'Ylabel')
get(get(AX(1),'Ylabel'))

xlabel('Time (\musec)','Fontsize',15);title('Multiple Decay Rates','Fontsize',15)
% check out the result of '\musec' in the xlabel in the previous command

set(H1,'LineStyle','-','lineWidth', 2, 'color', 'b') % here H1 is plot landle
set(H2,'LineStyle','-' ,'lineWidth', 2, 'color', 'r')

set(AX(1),'ycolor','b','lineWidth', 2) % y1 axis color
set(AX(2),'ycolor','r','lineWidth', 2) % y2 axis color

% Get exactly what you see on your screen
figure_size = get(gcf, 'position')
set(gcf,'PaperPosition',figure_size/100);

% interesting to try out
% [AX,H1,H2] = plotyy(x,y1,x,y2,'bar','plot'); %[axes handle, line1 h, line2 h]
Рекомендации по теме
Комментарии
Автор

How can we add error bar using this function [AX, H1, H2] = plotyy(x, y1, x, y2)?

yusufarslan
Автор

can we do the same objective but with the scope block in simulink ?

ahmedshaaban
Автор

how can i get axes of a tracked face..??

mohammadkashif
Автор

I heard strong Chinese English.  Keep going.

jiakunzhang