当前位置:网站首页>《Nature》论文插图复刻第3期—面积图(Part2-100)
《Nature》论文插图复刻第3期—面积图(Part2-100)
2022-07-24 11:05:00 【阿昆的科研日常】
在之前的文章中,复刻了《Nature》高清论文插图集Part2中的第456号插图的左下的多组柱状图:

Part1中第305号插图左侧的横向单组多色柱状图:

这一期,我们来复刻《Nature》高清论文插图集Part2中第100号插图(以下简称100)右上方的面积图。

先来看一下复刻效果:

特别提示:Nature论文插图复刻系列,旨在降低科研绘图的门槛,让大家不再觉得“顶级期刊里的论文插图对自己来说遥不可及”。如果觉得有用,不妨分享给你身边的人。
1 要素分析
100中每一曲线对象利用具有一定透明度的不同颜色进行了填充,这些颜色在左上图(a)的Legend中可以找到。
此外,其坐标轴左、上、右部分都是没有刻度的,且其下方轴线的刻度标签是竖排文字。
这些都是需要注意的点。
2 复刻工具
Matlab R2022a
Matlab科研绘图插件-ColorCopy配色方案提取工具
Matlab科研绘图插件-ColorMap渐变色生成/编辑工具
Matlab科研绘图插件-Fig2Data图片原始数据提取工具
3 数据准备及配色方案提取
此部分主要是提取100中的数据以及配色方案,以用于绘图。
首先,使用Fig2Data工具提取图中曲线数据(为了方便,仅提取了20条曲线中的其中16条用于后续处理)。

由于使用Fig2Data工具手工提取的曲线采样密度不够,直接成图的话会有一些‘棱角分明’:

因此利用‘interp1’命令,采用‘spline’插值方法对手工采样点进行加密:

加密后的数据保存在了datax.mat和datay.mat文件中。
%% 数据准备% 读取数据% 自变量dataxload datax.mat;% 因变量datayload datay.mat;
然后,利用ColorCopy工具提取配色方案:
%% 颜色提取C = ColorCopy;close

由于原始曲线为20条,而我只提取了其中的16条,因此需要重新分配颜色。
然而,原文作者使用的是渐变色配色,如果任意分配,可能会导致颜色变化不均匀。
因此,这里我使用了ColorMap渐变色生成/编辑器对ColorCopy所得到的颜色矩阵C进行了降采样:
C = ColorMap(C,N);其中,N表示降采样后颜色的数量,即16。
4 绘图
首先,利用‘area’命令绘制初始的面积图。
for i = 1:Narea(datax(i,:),datay(i,:),'LineWidth',2,'FaceColor',C(i,:),'EdgeColor',C(i,:),...'FaceAlpha',.3,'EdgeAlpha',1);hold onendhXLabel = xlabel('Cortical depth (normalized)');hYLabel = ylabel('cell density');hTitle = title('MOp cells');

为了避免坐标轴遮挡问题,使用‘plot’命令再绘制一条坐标轴。
hold onplot(0:0.2:1.2,zeros(1,7),'k','LineWidth', 1)

再然后,对照原图,对坐标区细节进行进一步的调整:
% 坐标轴参数调整set(gca, 'LineWidth', 1,... % 线宽'Box', 'off', ... % 边框'XGrid', 'off', 'YGrid', 'off', ... % 网格'TickDir', 'out', 'TickLength', [.01 .01], ... % 刻度'XMinorTick', 'off', 'YMinorTick', 'off', ... % 小刻度'XColor', [.1 .1 .1], 'YColor', [.1 .1 .1],... % 坐标轴颜色'XTick', 0:0.2:1.2,... % 刻度与范围'XLim', [-0.05 1.1],...'XTickLabels',{num2str([0:0.2:1]','%.1f')},...'XTickLabelRotation',90,...'YTick', [],...'YLim', [0 1])% 添加上、右框线hold onXL = get(gca,'xlim'); XR = XL(2);YL = get(gca,'ylim'); YT = YL(2);xc = get(gca,'XColor');yc = get(gca,'YColor');plot(XL,YT*ones(size(XL)),'color', xc,'linewidth',1)plot(XR*ones(size(YL)),YL,'color', yc,'linewidth',1)% 字体字号set(gca, 'FontName', 'Arial', 'FontSize', 12)set([hXLabel,hYLabel], 'FontName', 'Arial', 'FontSize', 13)set(hTitle, 'FontSize', 14)% 背景颜色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');

可以说还原度还是比较高的。
大家还想看我复刻哪张图,可以告诉我号码。
以上。
获取方式:
边栏推荐
- Four components and working principle of frequency converter
- Simply understand MODBUS function code and partition
- MySQL根据备注查询表、字段
- web咸鱼自救攻略--typescript的类没有你想象中的那么难
- Zero basic learning canoe panel (6) -- switch/indicator
- Zero basic learning canoe panel (3) -- static text, group box, picture box
- Use Modelsim to independently simulate Altera and Xilinx IP cores
- Neo4j installation tutorial
- Value and technical thinking of vectorization engine for HTAP
- Fiddler抓包工具总结
猜你喜欢

浅析拉格朗日乘数法及其对偶问题
![[live registration] analysis of location cache module and detailed explanation of OCP monitoring and alarm](/img/d8/a367c26b51d9dbaf53bf4fe2a13917.png)
[live registration] analysis of location cache module and detailed explanation of OCP monitoring and alarm

在idea中System.getProperty(“user.dir“)识别到模块(module)路径的方法:Working directory的设置

Docker builds MySQL master-slave replication

Five application scenarios of Bluetooth module

Self taught software testing talent -- not covered

Data visualization - White Snake 2: black snake robbery (1)

Disk storage chain B-tree and b+ tree

Idea hidden Idea folder hides.Iml files

Publish local image to private library
随机推荐
No one knows what ingredients tiktok's latest popular product pink sauce contains
关于【软件测试-自动化测试之面试技巧和注意事项】——侃侃而谈
零基础学习CANoe Panel(7)—— 文件选择(PathDiaglog)
Idea hidden Idea folder hides.Iml files
BBR and queuing
Redis cluster setup
Zero basic learning canoe panel (7) -- file selection (pathdiaglog)
TwinCAT3各版本下载路径
Zero basic learning canoe panel (8) -- hex/text editor
只会“点点点”,凭什么让开发看得起你?
Zero basic learning canoe panel (3) -- static text, group box, picture box
BBR 与 queuing
JMeter interface test steps - Installation Tutorial - script recording - concurrent test
蓝牙模块的5大应用场景
Filter the data with signal processing toolbox software
自动推理的逻辑06--谓词演算
FastCGI运行原理及php-fpm参数配置
如何在家中使用 SSH 和 SFTP 协议
Build resume editor based on Nocode
【类、抽象与继承】