
Hao B.
V1
2023/01/01阅读:24主题:重影
优化科研数据图
优化科研数据图系列
让SCI作图变得更简单、更规范和更好看。
这幅图的技巧虽然不多,但都很实用。
1 结果展示和对比
2 源码文件
% ----------PART ONE----------%
% 读入文件的路径
path_Ka = fullfile("D:\Sci_Graph\0101", "data.xlsx");
% 加载压力数据
Ka = readtable(path_Ka, "Range", "A1:B10000", "Sheet", "data", "ReadVariableNames", false);
% 调取Ka
KaX = Ka(:, 1).Var1;
loc = isnan(KaX);
KaX(loc) = [];
kaY = Ka(:, 2).Var2;
loc = isnan(kaY);
kaY(loc) = [];
% ----------PART TWO----------%
%---绘图---
frame_tiledlayout(1, 1, "compact", "tight");
nexttile
x = 10^-2 : 100 : 10^3;
y = 10^-2 : 100 : 10^3;
p = loglog(x, y);
p.LineStyle = "none";
hold on
% Ka
p_Ka = loglog(KaX, kaY);
p_Ka.LineStyle = "none";
p_Ka.Color = "r";
p_Ka.Marker = "s";
p_Ka.MarkerSize = 8;
p_Ka.MarkerEdgeColor = "r";
p_Ka.MarkerFaceColor = "r";
% 设置轴、图例等样式
ax = gca;
ax.FontName = "Arial";
ax.FontSize = 12;
ax.Box = "on";
ax.XColor = "k";
ax.YColor = "k";
ax.LineWidth = 0.8;
ax.XMinorTick = "on";
ax.YMinorTick = "on";
% ----------PART THREE----------%
% 辅助线
line([0.01, 100], [0.1, 0.1], 'Linestyle', '--', 'Color', 'b', 'linewidth', 1);
line([0.01, 1000], [10, 0.031624], 'Linestyle', '--', 'Color', 'b', 'linewidth', 1);
line([0.025, 1], [1000, 1], 'Linestyle', '--', 'Color', 'b', 'linewidth', 1);
line([1, 1], [1, 1000], 'Linestyle', '--', 'Color', 'b', 'linewidth', 1);
line([100, 100], [0.1, 1000], 'Linestyle', '--', 'Color', 'b', 'linewidth', 1);
% 标注
at_01 = annotation('textarrow',[0.409222222222222 0.439460317460317],...
[0.694523809523809 0.60757671957672], ...
'String', {'t=6ms'}, ...
'HeadWidth', 8,...
'HeadLength', 8,...
'FontSize', 12,...
'FontName','Arial');
at_02 = annotation('textarrow',[0.522615079365089 0.532440476190486],...
[0.694259259259267 0.605264550264558], ...
'String',{'t=20ms'}, ...
'HeadWidth', 8,...
'HeadLength', 8,...
'FontSize', 12, ...
'FontName','Arial');
at_03 = annotation('textarrow',[0.642055555555559 0.650119047619051],...
[0.692243386243392 0.60892063492064], ...
'String', {'t=30ms'}, ...
'HeadWidth', 8,...
'HeadLength', 8,...
'FontSize', 12,...
'FontName','Arial');
at_04 = annotation('textarrow',[0.751920634920636 0.753936507936509],...
[0.693587301587302 0.610264550264551], ...
'String', {'t=27ms'}, ...
'HeadWidth', 8,...
'HeadLength', 8,...
'FontSize', 12, ...
'FontName','Arial');
t_01 = annotation('textbox',...
[0.243951612903226 0.750000000000001 0.0846774207728525 0.105182795698925],...
'VerticalAlignment', 'middle',...
'String', {'L_{G}'},...
'Margin', 0,...
'HorizontalAlignment','center',...
'FitBoxToText', 'off',...
'EdgeColor', 'none',...
'BackgroundColor', 'w', ...
'Interpreter', 'tex', ...
'FontName', 'Arial', ...
'FontSize', 12, ...
'color', 'r');
t_02 = annotation('textbox',...
[0.530241935483871 0.359215052225257 0.0866935498531788 0.0981182811080769],...
'VerticalAlignment', 'middle',...
'String', {'\eta'},...
'Margin', 0,...
'HorizontalAlignment', 'center',...
'FitBoxToText', 'off',...
'FontWeight', 'bold',...
'FontSize', 15,...
'FontName', 'Arial',...
'FitBoxToText', 'off',...
'EdgeColor', 'none',...
'BackgroundColor', [1 1 1], ...
'Interpreter', 'tex', ...
'color', 'r');
t_03 = annotation('textbox',...
[0.373991935483871 0.240935481691873 0.0917338731548479 0.0913978516414602],...
'VerticalAlignment','middle',...
'String', {'d_R'},...
'Margin', 0,...
'HorizontalAlignment','center',...
'FontSize',12,...
'FontName','Arial',...
'FitBoxToText','off',...
'EdgeColor','none',...
'BackgroundColor',[1 1 1], ...
'Interpreter', 'tex', ...
'color', 'r');
t_04 = annotation('textarrow',[0.516129032258065 0.477822580645161],...
[0.873655913978495 0.814516129032258], ...
'String', {'Ka_{\deltaL}=1'},...
'HeadWidth',8,...
'FontSize',12,...
'FontName','Arial');
t_05 = annotation('textarrow',[0.844758064516129 0.816532258064516],...
[0.876344086021505 0.811827956989247], ...
'String','Ka_{\deltaR}=1',...
'HorizontalAlignment','left',...
'HeadWidth',8,...
'FontSize',12);
t_06 = annotation('textbox',...
[0.809475806451613 0.625344083457867 0.164314520046595 0.107526884284071],...
'VerticalAlignment','middle',...
'String',{'Broken','reaction','zones'},...
'Margin',0,...
'HorizontalAlignment','center',...
'FontName','Arial',...
'FitBoxToText','off',...
'EdgeColor','none', ...
'FontWeight', 'bold', ...
'color', 'b', 'FontSize',12);
t_07 = annotation('textbox',...
[0.139112903225806 0.629376341522382 0.164314520046596 0.107526884284071],...
'VerticalAlignment','middle',...
'String',{'Wrinkled','flamelets'},...
'Margin',0,...
'HorizontalAlignment','center',...
'FontName','Arial',...
'FitBoxToText','off',...
'EdgeColor','none', ...
'FontWeight', 'bold', ...
'color', 'b', 'FontSize',12);
t_08 = annotation('textbox',...
[0.142137096774194 0.318892470554641 0.39616935483871 0.107526884284071],...
'VerticalAlignment','middle',...
'String',{'Laminar flamelets DNS'},...
'Margin',0,...
'HorizontalAlignment','center',...
'FontName','Arial',...
'FitBoxToText','off',...
'EdgeColor','none', ...
'FontWeight', 'bold', ...
'color', 'b', 'FontSize',12);
t_09 = annotation('textbox',...
[0.434475806451613 0.141473115715931 0.164314520046596 0.107526884284071],...
'VerticalAlignment','middle',...
'String',{'DNS'},...
'Margin',0,...
'HorizontalAlignment','center',...
'FontName','Arial',...
'FitBoxToText','off',...
'EdgeColor','none', ...
'FontWeight', 'bold', ...
'color', 'b', 'FontSize',12);
t_10 = annotation('textarrow',[0.824596774193548 0.891129032258065],...
[0.188172043010753 0.231182795698925], ...
'String',{'Re_{\Delta}=1'},...
'HeadWidth',8,...
'FontSize',12,...
'FontName','Arial');
t_11 = annotation('textbox',...
[0.283266129032258 0.832333330769696 0.164314520046596 0.107526884284071],...
'VerticalAlignment','middle',...
'String',{'Corrugated','flamelets'},...
'Margin',0,...
'HorizontalAlignment','center',...
'FontName','Arial',...
'FitBoxToText','off',...
'EdgeColor','none', ...
'FontWeight', 'bold', ...
'color', 'b', ...
'FontSize',12);
t_12 = annotation('textbox',...
[0.47892857142857 0.756619046438311 0.312857149890491 0.073333334514073],...
'Color',[0 0 1],...
'VerticalAlignment','middle',...
'String',{'Thin reaction zones'},...
'Margin',0,...
'HorizontalAlignment','center',...
'FontWeight','bold',...
'FontSize',12,...
'FitBoxToText','off',...
'EdgeColor','none', 'color', 'b');
% 设置轴标题
xlb = xlabel("Ka");
xlb.FontName = "Arial";
xlb.FontSize = 14;
ylb = ylabel("\Delta / \delta_L");
ylb.FontName = "Arial";
ylb.FontSize = 14;
hold off
欢迎讨论和纠错。
作者介绍

Hao B.
V1