海洋上常用要在一幅图上同时绘出温度、盐度、密度曲线,如图
3 L6 o; P, S2 j/ _) y
+ ^1 m. t h; R8 d; [# k6 N
可以使用floatAxis函数,地址为: i6 M) Q" ~8 [$ F5 L! d: r
http://www.mar.dfo-mpo.gc.ca/science/ocean/epsonde/programming.html
上图使用floatAsixX.m函数可以绘制类似图像
调用方式为,[hl1,ax2,ax3] = floatAxisX(varargin)
hl1: line 的句柄
ax2: line所在axis的句柄,即图像所在坐标轴的句柄- t1 q0 V; a4 y$ k9 i, J
ax3:浮动x轴的句柄0 L3 ?7 Y5 I( G6 x- ^* X+ G
这个函数事实上是绘制了两幅图,) [( l5 E$ X8 W
把线画在上面的大图中,在图下面又绘制一个x轴,作为该line的x轴# E8 [3 G9 n G: D
& o- H( T3 U" \; ~2 C
varagin:variable argument input 输入变量* Y0 l- ^. @2 K, [
nargin=2
输入 x,y值
nargin=3
定义曲线,默认为‘k-’,黑实线
nargin=4
定义x轴label,‘string’+ v- o9 B9 _& f8 W9 p5 l. L4 r/ G
nargin=56 w% L, I6 V9 c9 p
定义x,y范围, [xmin,xmax,ymin,ymax]
首先plot一个正常图像,以此作为之后float轴的基准
然后再用floataxis函数加入其它参量绘图# \; l t* o8 S& ]* O' }0 d+ m
运行Demo进行对比:CTDplotX.m6 ~6 p( U9 N1 }' l0 l* |) A" ]
5 N% M% j+ q( c
! M# F; ~9 ]1 O: q6 ?8 @: L& T
实例使用可参考下一篇日志
matlab contour等值线设置 双横坐标 floatAxisX,labelspacing
http://hi.baidu.com/curbzz/blog/item/a5449ad7fb9483c850da4bdd.html
| 欢迎光临 EDA365电子论坛网 (https://bbs.eda365.com/) | Powered by Discuz! X3.2 |