收藏本站 劰载中...网站公告 | 吾爱海洋论坛交流QQ群:835383472

【MATLAB】嵌套坐标的相关设置

[复制链接]
在大的背景下添加相关坐标0 Z5 ~: T. |' x9 i& C
close all;figure('position',[50 100 1850 900],'color','w')
- K8 ~8 |/ M3 R! x; \* Daxes('position',[0.055 0.2 0.9 0.7])8 H" m5 A: |  U2 v4 x! ?3 i5 C1 W/ y; z! U
itv=linspace(min(rho_xi_eta(),max(rho_xi_eta(),30);
& w. a* a% F6 T: b+ c0 f$ O/ Qcontourf(xi,eta,rho_xi_eta,itv,'edgecolor','none'); H7 o: C1 ^- `) h4 m" J. X
hold on;
; _$ f  j5 R5 \0 v& J5 ~contour(xi,eta,rho_xi_eta,itv,'k-','linewidth',1.5)
2 k* k7 I3 d2 o# B: S3 s# I......& T( ~/ L% K. \! _. k

" ~3 V8 \7 {/ G  K1 b$ v- ?
8 p) F! i, M. V9 q% 添加坐标! t6 \3 e) n# W% X7 p& \+ u
aa=get(gca,'position');) c$ @6 U+ c6 l
h1=axes('position',[0.5 aa(2) 0.05 aa(end)]);
% |5 @" J. O- t6 M4 O- o6 ]set(h1,'color','none')    %设置透明背景
" X4 l! x) ~& Q1 v* q  k2 {) iset(gca,'ycolor','none') %隐藏y轴5 }/ |& s& W* q/ E+ F
set(gca,'xcolor','none') %隐藏x轴
  `5 q# ^& _% i2 o3 Pbox off;
# H  y4 J! c' N
! n( D8 M8 @" C8 c: ?
- m7 ]- C. ?% f( c% m/ c$ A5 s, vcolorseq=mycolor.color94;
2 k) _, e3 t. Zcolor_str=colorseq(1:70:end,;: W& b- u: b2 K
for nn=29 a& D4 ]6 ^2 o
    hold on;3 M& A( M( U7 ], Z/ [6 `% w! b
    ii=find(xi(1,==nn);7 Z5 E' x" F; u2 k
    h1=plot(f_eta(:,ii),eta(:,ii),'color',color_str(nn+1,,'linewidth',2);# [$ u1 c: M4 a. P& |* U
end5 {* [0 s$ Q* w% c; N) m
legend('\xi=2')* B" j# \1 L  q3 c: E

: z; T0 X$ N5 A5 {7 ?5 L
& J2 a4 A$ R! l, N3 r* E+ Rh=line([0 0],[0 0.9],'color','k');
' o7 y$ q# X! b0 Cset(h,'linestyle','--','linewidth',1.5)6 ?7 H: H+ \+ M! j1 G
set(get(get(h,'Annotation'),'LegendInformation'),'IconDisplayStyle','off'); %设置不显示这条线的legend
4 O8 B, `& M1 _. rxlim([-1.5 1.5]*1e-8)/ d: v/ q% Q7 @
set(gca,'xtick',[-10:5:5]*1e-9)
# |9 p8 N, M' {% d8 Fh1=line([-10 5]*1e-9,[delta delta],'color','k');" A4 ^' M8 o; \4 l5 K
set(h1,'linestyle','--','linewidth',1.5)
7 W" N9 Y8 f# ^* x# V. g* hset(get(get(h1,'Annotation'),'LegendInformation'),'IconDisplayStyle','off');( _* ~: F8 P4 z% n
ylim([0 1])1 {" ]& w* t& U3 |! O, Z

' H7 h( i0 e( D% L/ S' e9 D                               
登录/注册后可看大图
, F# Y  B+ p7 Q8 G1 l; t
3 f1 R6 o+ r4 D2 {
                    , r, u. T/ B# p

* ]4 U2 l  A: e2 A( {; G4 R                                        转载本文请联系原作者获取授权,同时请注明本文来自叶瑞杰科学网博客。
回复

举报 使用道具

相关帖子

全部回帖
暂无回帖,快来参与回复吧
懒得打字?点击右侧快捷回复 【吾爱海洋论坛发文有奖】
您需要登录后才可以回帖 登录 | 立即注册
黄金品质
活跃在2021-12-8
快速回复 返回顶部 返回列表