matlab 多个纵坐标

matlab 多个纵坐标

ID:13201455

大小:53.00 KB

页数:3页

时间:2018-07-21

matlab 多个纵坐标_第1页
matlab 多个纵坐标_第2页
matlab 多个纵坐标_第3页
资源描述:

《matlab 多个纵坐标》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库

1、帮找了一个Canadan做的,应该能解决楼主的问题。复制内容到剪贴板代码:function[ax,hlines]=plotyyy(x1,y1,x2,y2,x3,y3,ylabels)%PLOTYYY-Extendsplotyytoincludeathirdy-axis%Syntax:  [ax,hlines]=plotyyy(x1,y1,x2,y2,x3,y3,ylabels)%Inputs:x1,y1arethexdataandydataforthefirstaxes'line%      x2,y2are

2、thexdataandydataforthesecondaxes'line%      x3,y3arethexdataandydataforthethirdaxes'line%      ylabelsisa3x1cellarraycontainingtheylabelstrings%Outputs:ax-    3x1doublearraycontainingtheaxes'handles%      hlines-3x1doublearraycontainingthelines'handles%Auth

3、or:DenisGilbert,Ph.D.,physicaloceanography%MauriceLamontagneInstitute%Dept.ofFisheriesandOceansCanada%email:gilbertd@dfo-mpo.gc.ca  %Web:http://www.qc.dfo-mpo.gc.ca/iml/%April2000;Lastrevision:14-Nov-2001ifnargin==6  ylabels{1}='';ylabels{2}='';ylabels{3}='

4、';elseifnargin>7  error('Toomanyinputarguments')elseifnargin<6  error('Notenoughinputarguments')endfigure('units','normalized',...    'DefaultAxesXMinorTick','on','DefaultAxesYminorTick','on');[ax,hlines(1),hlines(2)]=plotyy(x1,y1,x2,y2);cfig=get(gcf,'color

5、');pos=[0.1  0.1  0.7  0.8];offset=pos(3)/5.5;pos(3)=pos(3)-offset/2;set(ax,'position',pos);  pos3=[pos(1)pos(2)pos(3)+offsetpos(4)];limx1=get(ax(1),'xlim');limx3=[limx1(1)  limx1(1)+1.2*(limx1(2)-limx1(1))];ax(3)=axes('Position',pos3,'box','off',...  'Colo

6、r','none','XColor','k','YColor','r',...    'xtick',[],'xlim',limx3,'yaxislocation','right');hlines(3)=line(x3,y3,'Color','r','Parent',ax(3));limy3=get(ax(3),'YLim');line([limx1(2)limx3(2)],[limy3(1)limy3(1)],...  'Color',cfig,'Parent',ax(3),'Clipping','off'

7、);axes(ax(2))set(get(ax(1),'ylabel'),'string',ylabels{1})set(get(ax(2),'ylabel'),'string',ylabels{2})set(get(ax(3),'ylabel'),'string',ylabels{3})实例:在CommondWindow里运行:复制内容到剪贴板代码:x=[00.10.20.30.40.4260.50.60.6880.70.80.91.0];y=[268.95272.36275.07277.07277.932

8、78276.5267.16248.2244.3200.37137.7158.7];a=[00.2250.4080.5660.6930.7180.7760.820.8310.8310.8180.7840.6];k=[2.552.2542.0631.8861.7331.6871.5521.3681.2071.1871.0230.8730.6];ylabels{1}='轴1';ylabels{2}='轴2

当前文档最多预览五页,下载文档查看全文

此文档下载收益归作者所有

当前文档最多预览五页,下载文档查看全文
温馨提示:
1. 部分包含数学公式或PPT动画的文件,查看预览时可能会显示错乱或异常,文件下载后无此问题,请放心下载。
2. 本文档由用户上传,版权归属用户,天天文库负责整理代发布。如果您对本文档版权有争议请及时联系客服。
3. 下载前请仔细阅读文档内容,确认文档内容符合您的需求后进行下载,若出现内容与标题不符可向本站投诉处理。
4. 下载文档时可能由于网络波动等原因无法下载或下载错误,付费完成后未能成功下载的用户请联系客服处理。