当前位置:网站首页>Matlab paper illustration drawing template No. 41 - bubble chart (bubblechart)
Matlab paper illustration drawing template No. 41 - bubble chart (bubblechart)
2022-08-02 06:09:00 【Akun's research routine】
shared in previous articlesMatlabA drawing template for a scatter bubble chart:

say bubble chart,Basically a scatterplot,Not very standard as a dissertation illustration.
所以,Let me share this timeMatlab自带气泡图的绘制模板.
先来看一下成品效果:

特别提示:Matlab论文插图绘制模板系列,旨在降低大家使用Matlab进行科研绘图的门槛,只需按照模板格式添加相应内容,即可得到满足大部分期刊以及学位论文格式要求的数据插图.如果觉得有用可以分享给你的朋友.
模板中最关键的部分内容:
1. 数据准备
此部分主要是读取数据,定义各变量.
% 读取数据
load data.mat
% x坐标
xx = data(:,1);
% y坐标
yy = data(:,2);
% 特征(Feature size corresponds to color/点的尺寸)
sz = data(:,3);
2. 颜色定义
颜色搭配比较考验个人审美,需要多加尝试.
这里直接用之前分享的addcolorplus工具中的渐变色:
%% 颜色定义
map = addcolorplus(300);
3. 气泡图绘制
使用‘bubblechart’命令,Draw an unglamorized bubble chart.
bubblechart(xx, yy, sz, sz,'MarkerFaceAlpha',0.7);
hTitle = title('BubbleChart');
hXLabel = xlabel('XAxis');
hYLabel = ylabel('YAxis');其中,第一个‘sz’Indicates the size of the bubble,第二个‘sz’Indicates the color of the bubble,Here I use the same feature,如果有需要,Another feature can be represented by bubble color.
值得一提的是,bubblechart函数需要Matlab R2020b以上.
4. 细节优化
为了插图的美观,利用’colormap’命令赋上之前选择好的颜色:
% 赋色
colormap(map)进一步,添加图例,Adjust the font size、背景颜色等属性:
% 坐标轴美化
set(gca, 'Box', 'on', ... % 边框
'XGrid', 'off', 'YGrid', 'off', ... % 网格
'TickDir', 'in', 'TickLength', [.01 .01], ... % 刻度
'XMinorTick', 'off', 'YMinorTick', 'off', ... % 小刻度
'XColor', [.1 .1 .1], 'YColor', [.1 .1 .1],... % 坐标轴颜色
'XTick', 0:2:24,... % 坐标区刻度、范围
'XLim', [0 23],...
'YTick', 0:0.2:1.2,...
'YLim', [0 1.2])
% 添加图例
blgd = bubblelegend('Style','vertical',...
'BubbleSizeOrder','descending',...
'box','off',...
'Location','northeastoutside',...
'NumBubbles',3,... ...
'FontName', 'Helvetica',...
'FontSize', 9);
colorbar('Position',[0.79,0.11,0.03,0.4])
% 字体和字号
set(gca, 'FontName', 'Helvetica')
set([hXLabel, hYLabel], 'FontName', 'AvantGarde')
set(gca, 'FontSize', 10)
set([hXLabel, hYLabel], 'FontSize', 11)
set(hTitle, 'FontSize', 12, 'FontWeight' , 'bold')
% 背景颜色
set(gcf,'Color',[1 1 1])设置完毕后,以期刊所需分辨率、格式输出图片.
%% 图片输出
figW = figureWidth;
figH = figureHeight;
set(figureHandle,'PaperUnits',figureUnits);
set(figureHandle,'PaperPosition',[0 0 figW figH]);
fileout = 'test';
print(figureHandle,[fileout,'.png'],'-r300','-dpng');
也可以尝试其它配色:




以上.
获取方式:
边栏推荐
猜你喜欢

CAN光端机解决泰和安TX3016C消防主机长距离联网问题 实现CAN与光纤之间的双向数据智能转换

MySQL String Concatenation - Various String Concatenation Practical Cases

如何运用3DGIS技术整合智慧社区综合管理解决方案

MySQL 字符串拼接 - 多种字符串拼接实战案例

MySQL(7)

ApiPost 真香真强大,是时候丢掉 Postman、Swagger 了

ORA-04044:此处不允许过程、函数、程序包或类型,系统分析与解决

12 reasons for MySQL slow query

Navicat如何连接MySQL

pg数据库报错问题,有懂的吗
随机推荐
2021年软件测试面试题大全
Mysql存储json格式数据
力扣 2127. 参加会议的最多员工数 拓扑剪枝与2360补充
UE4 蓝图实现AI随机移动
CNN 理解神经网络中卷积(大小,通道数,深度)
Centos7.9+mysql8.0开启指定IP远程连接数据库
MySQL(7)
Grid布局介绍
11种你需要了解的物联网(IoT)协议
mysql练习题
matlab simulink 模糊pid结合smith控制温度
力扣练习——42 二叉树的层次遍历 II
ORA-04044:此处不允许过程、函数、程序包或类型,系统分析与解决
系统(层次)聚类
牛客-TOP101-BM41
Mysql return table
MySQL导入sql文件的三种方法
Android studio连接MySQL并完成简单的登录注册功能
MobaXsterm如何使用
mysql 8.0.28版本安装配置方法图文教程