当前位置:网站首页>Matlab paper illustration drawing template No. 42 - bubble matrix diagram (correlation coefficient matrix diagram)
Matlab paper illustration drawing template No. 42 - bubble matrix diagram (correlation coefficient matrix diagram)
2022-08-03 19:43:00 【Akun's research routine】
在上一篇文章中,分享了Matlab气泡图的绘制模板:

进一步,Suppose we want to visualize a table or matrix,That is, the bubbles are arranged in a matrix,And the size and color of each bubble represent the value of its corresponding feature,应该怎么操作呢?
Take a look at the finished product:

特别提示:Matlab论文插图绘制模板系列,旨在降低大家使用Matlab进行科研绘图的门槛,只需按照模板格式添加相应内容,即可得到满足大部分期刊以及学位论文格式要求的数据插图.如果觉得有用可以分享给你的朋友.
模板中最关键的部分内容:
1. 数据准备
此部分主要是读取数据,Generate matrix coordinate data.
% 读取数据load data.mat% Generate matrix coordinate data[r,c] = size(data);x = 1:c;y = 1:r;[xx,yy] = meshgrid(x,y);yy = flipud(yy);
其中,利用‘meshgrid’command to generate coordinate data for a matrix.
值得注意的是,在竖直方向,The index numbering order of the matrix is opposite to the positive direction of the coordinate axis,所以使用‘flipud’command to flip the matrix upside down.
2. 颜色定义
由于It needs to be colored according to the size of the feature,So use a gradient color scheme.
这里直接用之前分享的addcolorplus工具的渐变色:
%% 颜色定义map = addcolorplus(300);

3. Bubble matrix graph drawing
使用‘bubblechart’命令,绘制Unprettified bubble matrix diagram.
bubblechart(xx(:),yy(:),data(:)*10,data(:),'MarkerFaceAlpha',1);hTitle = title('BubbleMatrix Plot');hXLabel = xlabel('XAxis');hYLabel = ylabel('YAxis');
其中, data(:)*10Used to define the bubble size,data(:)Used to define the bubble color,This is just to illustrate the two dimensions of features that can be represented by color and size.

4. 细节优化
为了插图的美观,使用colormap命令赋上之前选择好的颜色.
% 赋色colormap(map)
然后,使用‘bubblesize’The command defines the size of the smallest and largest bubbles:
% Adjust bubble sizebubblesize([10 30])

进一步,Make adjustments to the axes:
% 坐标轴美化axis equalset(gca, 'Box', 'on', ...'XGrid', 'on', 'YGrid', 'on', ...'TickDir', 'in', 'TickLength', [0 0], ...'XMinorTick', 'off', 'YMinorTick', 'off', ...'XColor', [.1 .1 .1], 'YColor', [.1 .1 .1],...'XTick', 0:1:c+1,...'XLim', [0 c+1],...'YTick', 0:1:r+1,...'YLim', [0 r+1],...'XTickLabel',{'','A1','A2','A3','A4','A5','A6','A7','A8','A9','A10',''},...'YTickLabel',{'','B1','B2','B3','B4','B5','B6','B7','B8','B9','B10',''})ytickangle(90)% 添加图例blgd = bubblelegend('Style','vertical',...'BubbleSizeOrder','descending',...'box','off',...'Location','northeastoutside',...'NumBubbles',3,... ...'FontName', 'Helvetica',...'FontSize', 10);colorbar('Position',[0.79,0.11,0.03,0.5])% 字体字号set(gca, 'FontName', 'Arial', 'FontSize', 10)set([hXLabel,hYLabel], 'FontName', 'Arial', 'FontSize', 11)set(hTitle, 'FontSize', 13, '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');

也可以尝试其它配色:




以上.
完整代码:
边栏推荐
猜你喜欢

Anaconda virtual environment migration

数据驱动的软件智能化开发| ChinaOSC

Network protocol-TCP, UDP difference and TCP three-way handshake, four wave

awk语法-02-运算、数组、格式化输出

线上一次JVM FullGC搞得整晚都没睡,彻底崩溃

友宏医疗与Actxa签署Pre-M Diabetes TM 战略合作协议

单调栈及其应用

安装radondb mysql遇到问题

Redis 内存满了怎么办?这样置才正确!

Reveal how the five operational management level of hundreds of millions of easily flow system
随机推荐
net-snmp编译报错:/usr/bin/ld: cannot find crti.o: No such file or directory
MySQL master-slave, 6 minutes you master!
Postgresql-xl global snapshot and GTM code walking (branch line)
Line the last time the JVM FullGC make didn't sleep all night, collapse
CS免杀姿势
高效目标检测:动态候选较大程度提升检测精度(附论文下载)
如何理解即时通讯开发移动网络的“弱”和“慢”
阿里巴巴政委体系-第五章、阿里政委体系建设
MySQL基础
京东云发布新一代分布式数据库StarDB 5.0
Matlab论文插图绘制模板第42期—气泡矩阵图(相关系数矩阵图)
阿洛的反思
设备树基本原理与操作方法
Compose原理-compose中是如何实现事件分法的
「游戏建模干货」建模大师几步操作,学习经典,赶紧脑补一下吧
虚拟机vmware设置nat模式上网
高位套牢机构,用友网络的信任危机是如何产生的?
Anaconda virtual environment migration
Brush the topic of mobile zero power button
MVC vs MVP