天空分享 http://blog.sciencenet.cn/u/lishihceng10

博文

matlab 绘制曲线图(设置纸质尺寸,出图大小,图例,等等)

已有 7617 次阅读 2015-6-13 15:54 |系统分类:科研笔记|关键词:学者

data=xlsread('data.xlsx');

x=data(1,:);

xx=[x;x;x;x;x;x;x;x];

y1=data(2:9,:);

y2=data(10:17,:);

y3=data(18:end,:);

h=figure(1);

subplot(131);

plot([1,1000],[1,1000],'--k');hold on;

plot(xx',y1','-o','MarkerSize',2,'MarkerFaceColor',[1,0,0],'MarkerEdgeColor','r');axis([1 1000 1 400]);

set(gca,'xtick',[1,200,400,600,800,1000],'Fontsize',8);

set (gca,'position',[0.08,0.15,0.27,0.8]);

xlabel('现状重现期');ylabel('情景重现期');

text(500,350,'Low');


subplot(132);

plot([1,1000],[1,1000],'--k');hold on;

plot(xx',y2','-o','MarkerSize',2,'MarkerFaceColor',[1,0,0],'MarkerEdgeColor','r');axis([1 1000 1 400]);

set(gca,'position',[0.39,0.15,0.27,0.8]);

set(gca,'xtick',[1,200,400,600,800,1000],'yticklabel',[],'Fontsize',8);

xlabel('现状重现期','Fontsize',8);

text(500,350,'High');

hleg =legend('y=x line','Longkou','Penglai','Yantai','Chengshantou','Shidao','Qianliyan','Xiaomaidao','Rizhao');

get(hleg,'position')

set(hleg,'Fontsize',6,'position',[0.5429 0.4847 0.05 0.13])

legend('boxoff')



subplot(133);

plot([1,1000],[1,1000],'--k');hold on;

plot(xx',y3','-o','MarkerSize',2,'MarkerFaceColor',[1,0,0],'MarkerEdgeColor','r');axis([1 1000 1 400]);

set (gca,'position',[0.7,0.15,0.27,0.8]);

set(gca,'xtick',[1,200,400,600,800,1000],'yticklabel',[],'Fontsize',8);

set(gcf,'units','centimeters','position',[3,3,16,5]);

xlabel('现状重现期');

text(500,350,'Mean');


set(gcf, 'PaperPositionMode', 'manual');

set(gcf, 'PaperUnits', 'centimeters');

set(gcf, 'PaperPosition', [0 0 15.5 6]);


print(gcf,'figure1.tif','-dtiff','-r300');




https://m.sciencenet.cn/blog-489011-897736.html

上一篇:湿地:我们的未来
下一篇:matlab 批量绘制曲线图,设置出图的位置,大小等

0

该博文允许注册用户评论 请点击登录 评论 (0 个评论)

数据加载中...

Archiver|手机版|科学网 ( 京ICP备07017567号-12 )

GMT+8, 2024-4-25 10:18

Powered by ScienceNet.cn

Copyright © 2007- 中国科学报社

返回顶部