matlab画分段纵坐标,matlab多坐标轴绘制方法

%双横坐标绘制

​x1 = [0:.1:40];

y1 = 4.*cos(x1)./(x1+2);

x2 = [1:.2:20];

y2 = x2.^2./x2.^3;

hl1 = line(x1,y1,'Color','r');

ax1 = gca;

set(ax1,'XColor','r','YColor','r')

ax2 =

axes('Position',get(ax1,'Position'),...

'XAxisLocation','top',...

'YAxisLocation','right',...

'Color','none',...

'XColor','k'

,'YColor','k');

hl2 =

line(x2,y2,'Color','k','Parent',ax2);

a4c26d1e5885305701be709a3d33442f.png 双横坐标绘制

​%双纵坐标轴

x = 0:0.01:20;

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,'plot');

set(get(AX(1),'Ylabel'),'String','SlowDecay')

set(get(AX(2),'Ylabel'),'String','FastDecay')

xlabel('Time (\musec)')

title('Multiple Decay Rates')

a4c26d1e5885305701be709a3d33442f.png双纵坐标轴

​function [ax,hlines] =

plotyyy(x1,y1,x2,y2,x3,y3,ylabels)

%PLOTYYY - Extends plotyyto include a third

y-axis

%

%Syntax:  [ax

  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值