figure文本框乱码 matlab_Matlab给系统自动生成的窗体Figure1改名称
a=get(gca);
x=a.XLim;%獲取橫坐標(biāo)上下限
y=a.YLim;%獲取縱坐標(biāo)上下限
k=[0.8 0.9];%給定text相對位置
x0=x(1)+k(1)*(x(2)-x(1));%獲取text橫坐標(biāo)
y0=y(1)+k(2)*(y(2)-y(1));%獲取text縱坐標(biāo)
t=sprintf('仿真修正:+ \n期望:O');
text(x0,y0,t,'fontsize',8);
其中各屬性的設(shè)置如下
畫等值線
[cc hh]=contour(peaks(30),'LINESPEC','b-')
clabel(cc,hh,'manual')
%寫文本
text(5,10,'\bf math \sl math \it math \rm math \alpha','color',[0.1 0.1 0.9],'fontsize',24)
%設(shè)置線寬
set(gca,'linewidth',2)
%寫標(biāo)題并設(shè)置字體的大小
ti=title('Title of My Figure','color','blue')
set(ti,'fontsize',24)
drawnow
%輸出文件
print -dpsc plotE.ps
print -append -dpsc plotE.ps
print -djpeg100 plotE.jpg
%給定圖窗口標(biāo)題
figure('Name','My Figure1')
%設(shè)置使用調(diào)色板
map=hsv(32);
colormap(map)
%設(shè)定等值線的范圍
caxis([-6 6])
%設(shè)定colorbar的方向和位置
hc=colorbar('hori');
po=get(hc,'position');
%set(hc,'position',[po(1) po(2)+0.14 po(3) po(4)-0.01]);
%set(hc,'XLim',[0 300]);
%設(shè)置繪圖的缺省值
set(0,'DefaultLineLineWidth',2)
set(0,'DefaultAxesFontSize',18)
set(0,'DefaultAxesLineWidth',2)
set(0,'DefaultAxesTickLength',[0.01 0.025])
set(0,'DefaultPatchLineWidth',2)
set(0,'DefaultSurfaceLineWidth',2)
set(0,'DefaultRectangleLineWidth',2)
set(0,'DefaultLineLineWidth','remove')
set(0,'DefaultAxesFontSize','remove')
set(0,'DefaultAxesLineWidth','remove')
set(0,'DefaultAxesTickLength','remove')
set(0,'DefaultPatchLineWidth','remove')
set(0,'DefaultSurfaceLineWidth','remove')
set(0,'DefaultRectangleLineWidth','remove')
%%set(0,'DefaultLineLineWidth','factory')
%%get(0,'factory')
%設(shè)置坐標(biāo)軸的間隔和顯示
set(gca,'XTick',[0:1:25],'YTick',[0:300:6000])
set(gca,'XTickLabelMode','manual')
set(gca,'XTickLabel','0|||||5|||||10|||||15|||||20|||||25|')
%分別設(shè)置等值線和等值線標(biāo)注的間隔
[cc hh]=contour(peaks(30),[-6:2:8])
c(cc,hh,[-6:4:8],'fontsize',15,'color','r','rotation',0,'labelspacing',200)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%幾個實例%%%%%
%給定月份名字
name='JanFebMarAprMayJunJulAugSepOctNovDec'
%給定每層深度
depth=[5 15 25 35 45 55 65 75 85 95 110 130 155 185 220 260 305 365 450 575 755 1115 1735 2615 3645 4830]
%給定經(jīng)緯度
x=31:1:288;
y=-61:1:61;
[lo la]=meshgrid(x,y);
%等值線間距
vt=2:2:30;
vs=30:0.5:36;
vc=10:5:200;
%打開文件讀取數(shù)據(jù)
h1=fopen(['plotE' '.dat']);
u=fscanf(h1,'%f',[258 123]);
v=fscanf(h1,'%f',[258 123]);
t=fscanf(h1,'%f',[258 123]);
s=fscanf(h1,'%f',[258 123]);
ccc=fscanf(h1,'%f',[258 123]);
%設(shè)置流速標(biāo)尺
u(20,220)=0.5;
%%%%%%%%figure1%%%%%%%%等值線
figure;
m_proj('Lambert','lon',[31 288],'lat',[-61 61]);
hold on;
[cc hh]=m_contour(lo,la,ccc);
c(cc,hh,'fontsize',6);
title('carbon concentration');
m_coast('patch',[0.1 0.1 0.8])
m_grid('linestyle','none','box','fancy','linewidth',2,'XaxisLocation','bottom')
print -dpsc mmap.ps
%%%%%%%%figure2%%%%%%%%矢量圖
figure;
m_proj('Equidistant','lon',[31 288],'lat',[-61 61]);
hold on;
m_coast('patch',[0.3 0.5 0.3]);
m_grid('linestyle','none','tickdir','out','linewidth',2,'XaxisLocation','top')
hq=m_quiver(lo,la,u',v',2)
set(hq,'color','b')
m_text(240,54,'0.5 cm s^{-1}','color','r','fontsize',10)
print -dpsc -append mmap.ps
%%%%%%%%figure3%%%%%%%%使用高分辨率岸線
figure;
m_proj('Equidistant','lon',[31 288],'lat',[-61 61]);
hold on;
m_contour(lo,la,t)
hq=m_quiver(lo,la,u,v,2)
set(hq,'color','b')
m_text(240,54,'50 cm s^{-1}','color','r','fontsize',10)
m_coast('patch',[0.1 0.1 0.8]);
m_grid('linestyle','none','tickdir','out','linewidth',2,'XaxisLocation','top')
%m_gshhs_i('patch',[0.1 0.1 0.8]);
%m_gshhs_h('patch',[0.1 0.1 0.6]);
%m_gshhs_h('save','gumby');
%m_usercoast('gumby','patch',[0.1 0.1 0.6]);
print -dpsc -append mmap.ps
%%%%%%%%figure4%%%%%%%%直線圖
figure;
m_proj('Equidistant','lon',[31 288],'lat',[-61 61]);
hold on;m_coast('patch',[0.1 0.1 0.8]);
lo1=[180:5:270]
la1=[-30:5:60]
m_line(lo1,la1,'marker','.','markersize',20,'linestyle','none')
m_grid('linestyle','none','tickdir','out','linewidth',2,'XaxisLocation','top','xtick',12)
print -dpsc -append mmap.ps
總結(jié)
以上是生活随笔為你收集整理的figure文本框乱码 matlab_Matlab给系统自动生成的窗体Figure1改名称的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 弯曲圆波导matlab_弯曲波导结构设计
- 下一篇: 三菱触摸屏通讯错误_三菱触摸屏常见问题及