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

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

[复制链接]
在大的背景下添加相关坐标8 o3 s6 w0 o; h( A
close all;figure('position',[50 100 1850 900],'color','w')) }8 [& `5 q3 _
axes('position',[0.055 0.2 0.9 0.7])/ q2 I2 O# E6 e8 \2 ^
itv=linspace(min(rho_xi_eta(),max(rho_xi_eta(),30);% @7 u4 L7 H  p( Q0 e; o
contourf(xi,eta,rho_xi_eta,itv,'edgecolor','none')" X& G+ L5 V! x( H& F, T
hold on;
. r2 ?' y5 A. Z/ x# Lcontour(xi,eta,rho_xi_eta,itv,'k-','linewidth',1.5)& x3 }2 D. U5 o7 n: a
......
/ u4 L: p8 Z& i! _; p( p& R" v8 I1 |

* c: J0 @; }% [  j$ B% 添加坐标) T' d9 ^4 Q" V+ f3 p) f7 R( P
aa=get(gca,'position');# \$ K5 `8 T" |! Z& r% S
h1=axes('position',[0.5 aa(2) 0.05 aa(end)]);# Q7 j, U+ m3 G
set(h1,'color','none')    %设置透明背景1 q2 d- o2 d( n+ `4 Z2 _- I8 n+ N
set(gca,'ycolor','none') %隐藏y轴
: @' N" \3 V" M& m# N& xset(gca,'xcolor','none') %隐藏x轴! y9 K' U# }$ O6 r$ C
box off;( U0 J& d: m# F- q; L1 m$ S
& U" d% g' \# m
2 g" o" ^; V: m* e, R
colorseq=mycolor.color94;
% e: m" R* Q. v* z, y) kcolor_str=colorseq(1:70:end,;! x5 g7 q3 t6 N; a" t1 N
for nn=2( B. Z0 k3 R, B2 L/ [
    hold on;
% ~# x; m7 V2 s7 S0 F3 n0 t& ~    ii=find(xi(1,==nn);% B; D) c# r5 V3 S3 Z8 N
    h1=plot(f_eta(:,ii),eta(:,ii),'color',color_str(nn+1,,'linewidth',2);
- l$ s) \9 m+ v% {end
1 p; r  a+ x5 h# Nlegend('\xi=2')4 E* q. K7 a) w

! s8 x* n2 R( E0 j' D& h* a6 L/ D( N+ m* @' a/ T( |% A3 P- q, @+ [
h=line([0 0],[0 0.9],'color','k');
; [; w! [+ m; S, G: Mset(h,'linestyle','--','linewidth',1.5)! {/ ~' ]5 d$ n& a
set(get(get(h,'Annotation'),'LegendInformation'),'IconDisplayStyle','off'); %设置不显示这条线的legend7 ?2 f$ J8 z; B/ @
xlim([-1.5 1.5]*1e-8)
  f2 b* |0 q' Q. Vset(gca,'xtick',[-10:5:5]*1e-9)  e( |* N/ h9 w
h1=line([-10 5]*1e-9,[delta delta],'color','k');2 f; C4 L9 a& _2 W9 l2 c
set(h1,'linestyle','--','linewidth',1.5)# R1 R& ^" ]& R6 w" ^7 G; B# e
set(get(get(h1,'Annotation'),'LegendInformation'),'IconDisplayStyle','off');' G) r( i& S& ~( x  I, m
ylim([0 1])$ q: T8 F) s% s# P3 H( B

! v2 X' V) |' y5 x4 M, B  h2 n) A                               
登录/注册后可看大图
$ b2 E5 A7 P( r/ X% q2 j% s

: t, F( t7 v. l! x                    
; a; a7 N4 H, _0 p9 c3 F/ |: P
: R+ Q8 n, C& i' ?4 p                                        转载本文请联系原作者获取授权,同时请注明本文来自叶瑞杰科学网博客。
回复

举报 使用道具

相关帖子

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