matlab画图相关设置

本文介绍了在Matlab中进行多子图操作的方法,包括如何处理多个pcolor或contourf图形只显示一个colorbar的问题,以及通过定义axes坐标轴位置实现子图布局。同时分享了作者常用的图形设置,如填色图和线图散点图的示例,展示了使用worldmap结合scatter和plot的组合效果。
摘要由CSDN通过智能技术生成

多子图

多个pcolor或contourf只显示一个colorbar

用axes定义坐标轴位置来实现,如果只对某一个subplot显示colorbar,会有图像大小不一致的问题。

demo:

top_margin = 0.04;      
btm_margin = 0.06;      
left_margin = 0.06;     
right_margin = 0.08;    
fig_margin = 0.05;      
row = 3;                 
col = 2;                 
clim = [-1 16];         
fig_height = (1- top_margin - btm_margin - (row-1) * fig_margin) / row;
fig_width = (1 - left_margin - right_margin - (col-1) * fig_margin) / col;
figure
count=0;
for i = 1 : row
    for j = 1 : col
        position = [left_margin + (j-1)*(fig_margin+fig_width),...
        1- (top_margin + i * fig_height + (i-1) * fig_margin), fig_width, fig_height];
       axes('position', position);
       count=count+1;
       pcolor(magic(coun
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值