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

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

[复制链接]
在大的背景下添加相关坐标
) r  e% Z( e* i3 _4 K# H3 N) }close all;figure('position',[50 100 1850 900],'color','w')
# |' L& ]8 t# [) uaxes('position',[0.055 0.2 0.9 0.7])  M7 y4 T1 q5 U# }: T( ?- |, w* d
itv=linspace(min(rho_xi_eta(),max(rho_xi_eta(),30);
  W5 M+ y# b* S1 s2 q6 Qcontourf(xi,eta,rho_xi_eta,itv,'edgecolor','none'). ?' R  V& R& R
hold on;
. s9 ~" W; p9 ]" L- ^7 Icontour(xi,eta,rho_xi_eta,itv,'k-','linewidth',1.5)8 ]- K& Z! P# r9 k9 b& P
......
1 b8 K8 j5 j! C- q: A1 y
' F  n$ `8 ]+ z! @  M3 E  h$ V. j$ R% k4 {3 O9 p, d9 u
% 添加坐标
$ P. I3 X% g3 T/ I2 A& Kaa=get(gca,'position');. W$ U- |/ n  v2 v* ]
h1=axes('position',[0.5 aa(2) 0.05 aa(end)]);8 I( {6 T1 B( v; K
set(h1,'color','none')    %设置透明背景
6 Y$ L3 J( e/ Z( ~* H$ y& Mset(gca,'ycolor','none') %隐藏y轴
2 U0 Z$ S  r% ~6 Uset(gca,'xcolor','none') %隐藏x轴8 Y, o3 W6 V9 F- ^$ h* }2 `
box off;
, y8 V5 t0 [; ~3 L5 B8 x* X# x9 U/ u+ ~& {$ r

& q9 m! u8 T& H: icolorseq=mycolor.color94;1 V" e4 q  }" P/ f6 S1 l, i
color_str=colorseq(1:70:end,;9 Z# \! {9 [- X- W* V+ L: y! d6 p
for nn=2& A) V9 t  P5 S! N1 i3 ]/ }
    hold on;
6 n/ q+ F7 v- E    ii=find(xi(1,==nn);% r! G7 b& _3 o7 l
    h1=plot(f_eta(:,ii),eta(:,ii),'color',color_str(nn+1,,'linewidth',2);- K" B. V6 R& a6 X  A8 ?5 q1 N5 P
end9 ?0 C" x- W. E  ~
legend('\xi=2')
, O: N) O8 d: y' G! [. V4 G3 d+ \: p& `5 s7 z5 t. q+ I& \
2 `% S5 q( K) r' B
h=line([0 0],[0 0.9],'color','k');
* G( @( u) r: g/ Oset(h,'linestyle','--','linewidth',1.5)& f; |: m- e. s5 k0 Y
set(get(get(h,'Annotation'),'LegendInformation'),'IconDisplayStyle','off'); %设置不显示这条线的legend1 C8 F8 ~' m% e$ ^: X! W
xlim([-1.5 1.5]*1e-8)6 g$ g" n) p7 x) T8 w" [; o9 h1 }
set(gca,'xtick',[-10:5:5]*1e-9)/ I2 |( B" _( @0 _
h1=line([-10 5]*1e-9,[delta delta],'color','k');' @- \  }( l0 p8 f) O: K3 x9 `
set(h1,'linestyle','--','linewidth',1.5)* j" l7 {7 i  K
set(get(get(h1,'Annotation'),'LegendInformation'),'IconDisplayStyle','off');
8 ]: W2 L  g2 s( U6 _8 r" L( Kylim([0 1]); O1 u  P4 d: @- Q1 e4 G9 C2 E

  [) Y! q- m( ?% P                               
登录/注册后可看大图

$ ]2 C- V6 G8 y
# B  a2 C6 z- z; _8 ]3 g- f                    ( G- d# f: M5 I3 @7 W7 l- ^! l% [

, M, h. L: q0 L8 U                                        转载本文请联系原作者获取授权,同时请注明本文来自叶瑞杰科学网博客。
回复

举报 使用道具

相关帖子

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