【MATLAB】全网入门快、免费获取、持续更新的科研绘图教程系列1

news2024/9/23 17:15:32

1 【MATLAB】科研绘图第一期点线图

%% Made by Lwcah
%% 公众号:Lwcah
%% 知乎、B站、小红书、抖音同名账号:Lwcah,感谢关注~
%% 更多MATLAB+SCI绘图教程敬请观看~

%% 清除变量
clc; clear all; close all;

%% 一幅图的时候figureWidth = 8.5;figureHeight = 8;调整这两个参数就可以
%定义整幅图出现的在电脑屏幕上的位置以及长和宽
%这里有必要解释一下为什么figureWidth要设置为8.5;
%因详细解释需要很长的篇幅,请转公众号观看2023-03-21的文章观看。
figureUnits = 'centimeters';
figureWidth = 8.5;
figureHeight = 8;
set(gcf, 'Units', figureUnits, 'Position', [0 0 figureWidth figureHeight]);

%% 定义字体和字号大小
%% 通常的SCI一般Arial字体和10字号通用
fontnamed='Arial';%字号名字
ssize=10;%字号大小
%% 定义颜色
load picture20%加载第一张图的颜色
C1=Color(1,:)./256;
C2=Color(2,:)./256;
C3=Color(3,:)./256;
C4=Color(4,:)./256;
C5=Color(5,:)./256;
C6=Color(6,:)./256;

%% 开始绘图
x=[1;2;3;4;5;6];
y1=[1;1;1;1;1;1];
y2=[2;2;2;2;2;2];
y3=[3;3;3;3;3;3];
y4=[4;4;4;4;4;4];
y5=[5;5;5;5;5;5];
y6=[6;6;6;6;6;6];

%% 绘制散点连线图
h1 = line (x,y1,'LineStyle','--','Marker','o','LineWidth',1,'Color',C1, 'MarkerEdgeColor',C1,'MarkerFaceColor',C1);hold on;
h2 = line (x,y2,'LineStyle','--','Marker','o','LineWidth',1,'Color',C1, 'MarkerEdgeColor',C2,'MarkerFaceColor',C2);hold on;
h3 = line (x,y3,'LineStyle','--','Marker','o','LineWidth',1,'Color',C1, 'MarkerEdgeColor',C3,'MarkerFaceColor',C3);hold on;
h4 = line (x,y4,'LineStyle','--','Marker','o','LineWidth',1,'Color',C2, 'MarkerEdgeColor',C4,'MarkerFaceColor',C4);hold on;
h5 = line (x,y5,'LineStyle','--','Marker','o','LineWidth',1,'Color',C2, 'MarkerEdgeColor',C5,'MarkerFaceColor',C5);hold on;
h6 = line (x,y6,'LineStyle','--','Marker','o','LineWidth',1,'Color',C2, 'MarkerEdgeColor',C6,'MarkerFaceColor',C6);hold on;

%% 画图的标准格式代码
% text(0.7,-0.10,'(b) Honor','fontsize',ssize,'FontName',fontnamed);%,'horiz','center'
% text(0.6,-0.20,str_equation,'fontsize',ssize,'FontName',fontnamed,'color',C2);
xlabel('X (m)','fontsize',ssize,'FontName',fontnamed);
ylabel('Y (m)','fontsize',ssize,'FontName',fontnamed);
axis([0 7 0 8]);
xticks([0 1 2 3 4 5 6 7]);%画格网的时候的小刻度
xticklabels({'0','1','2','3','4','5','6','7'});%加x轴刻度标注
yticks([0 1 2 3 4 5 6 7 8]);%画格网的时候的小刻度
yticklabels({'0','1','2','3','4','5','6','7','8'});%加y轴刻度标注
set(gca,'linewidth',1,'fontsize',ssize,'FontName',fontnamed);
% set(gca,'yticklabel',[]);%y轴不显示
% set(gca,'xticklabel',[]);%x轴不显示
grid on;box on;hold on;

%% 画legend
%位置可置换 North South East West NorthEast NorthWest SouthEast SouthWest
%方法一
% kk=legend([h1,h2,h3],'0-90','270-360','Fusion');%robust\_median
% set(kk,'location','NorthEast','orientation','horizontal','Box', 'off','fontsize',ssize,'FontName',fontnamed);%,'Orientation','horizontal'
%方法二
columnlegend(3,{'h1','h2','h3','h4','h5','h6'},'North');%表示一行放三个图例以及图例的位置

%% 背景颜色
set(gcf,'Color',[1 1 1])
%% 图片输出
figW = figureWidth;
figH = figureHeight;
set(figureHandle,'PaperUnits',figureUnits);
set(figureHandle,'PaperPosition',[0 0 figW figH]);
fileout = 'demo_plot20';
print(figureHandle,[fileout,'.png'],'-r600','-dpng');

2 【MATLAB】科研绘图第二期三维柱状图

%% Made by Lwcah(公众号:Lwcah)
%% 公众号:Lwcah
%% 知乎、B站、小红书、抖音同名账号:Lwcah,感谢关注~
%% 更多MATLAB+SCI绘图教程敬请观看~

%% 三维柱状图的绘制模板
close all;clear all;clc;

%% 1行1列
%% 一幅图的时候figureWidth = 8.5;figureHeight = 8;调整这两个参数就可以
%定义整幅图出现的在电脑屏幕上的位置以及长和宽
%这里有必要解释一下为什么figureWidth要设置为8.5;
%因详细解释需要很长的篇幅,请转公众号观看2023-03-23的文章观看。
figureHandle = figure;
figureUnits = 'centimeters';
figureWidth = 8.5;
figureHeight = 6;
set(gcf, 'Units', figureUnits, 'Position', [0 0 figureWidth figureHeight]);

%% 数据准备
% 定义自变量
X = [1 2 3 4 5 6 7 8 9 10 11 12 13];%13
Y = [1 2 3 4];%4
% 定义因变量
Z1 = [1 2 3 4 5 6 7 6 5 4 3 2 1];
Z2 = [2 3 4 5 6 7 7 7 6 5 4 3 2];
Z3 = [2 3 4 5 6 7 7 7 6 5 4 3 2];
Z4 = [1 2 3 4 5 6 7 6 5 4 3 2 1];
Z=[Z1;Z2;Z3;Z4];%4x13

%% 定义字体和字号大小
%% 通常的SCI一般Arial字体和10字号通用
fontnamed='Arial';%字号名字
ssize=10;%字号大小

%% 给定绘图渐变色
load map10%更换map1到map10替换颜色
CM1 = map;

%% 定义绘图参数
b = bar3(Z,0.5);
% hTitle = title(sprintf('(a) RMSE/m (free snow)'));
hXLabel = xlabel('Types','fontsize',ssize,'FontName',fontnamed,'rotation',45);
hYLabel = ylabel('Solutions','fontsize',ssize,'FontName',fontnamed,'rotation',-45);
hZLabel = zlabel('Values','fontsize',ssize,'FontName',fontnamed);

%% 按照Z轴赋色
for k = 1:length(b)
    zdata = b(k).ZData;
    b(k).CData = zdata;
    b(k).FaceColor = 'interp';
end
colormap(CM1);%使用自定义的颜色
cb = colorbar;%添加垂直颜色栏
set(cb,'unit','centimeters','position',[9.3,2.8,0.2,2.5]);%设置垂直颜色栏的位置及大小


%% 画图的标准格式代码
% text(0.5,0.9,'(a) snow','fontsize',ssize,'FontName',fontnamed);%,'horiz','center'
% xlabel('SNR types','fontsize',ssize,'FontName',fontnamed);
% ylabel('R (with snow)','fontsize',ssize,'FontName',fontnamed);
axis([0 14 0 5 0 8]);%XYZ轴的范围
xticks([1 2 3 4 5 6 7 8 9 10 11 12 13]);%画格网的时候的小刻度
xticklabels({'1','2','3','4','5','6','7','8','9','10','11','12','13'});%加x轴刻度标注,'C3-MEO-S2I','C3-MEO-S6I'
yticks([1 2 3 4]);%画格网的时候的小刻度
yticklabels({'1','2','3','4'});%加x轴刻度标注
zticks([0 2 4 6 8]);%画格网的时候的小刻度
zticklabels({'0','2','4','6','8'});%加x轴刻度标注
set(gca,'xticklabelrotation',-45);
set(gca,'yticklabelrotation',45);
% set(gca,'linewidth',1,'fontsize',ssize,'FontName',fontnamed);
% set(gca,'yticklabel',[]);%y轴不显示
% set(gca,'xticklabel',[]);%x轴不显示
grid on;box on;hold on;

%% 背景颜色
set(gcf,'Color',[1 1 1])
%% 设置完毕后,按照所需分辨率、格式输出
figW = figureWidth;
figH = figureHeight;
set(figureHandle,'PaperUnits',figureUnits);
set(figureHandle,'PaperPosition',[0 0 figW figH]);
fileout = 'bar10';
print(figureHandle,[fileout,'.png'],'-r800','-dpng');

3 【MATLAB】科研绘图第三期二维柱状图

%% Made by Lwcah in 2023-03-25(公众号:Lwcah)
%% 公众号:Lwcah
%% 知乎、B站、小红书、抖音同名账号:Lwcah,感谢关注~
%% 更多MATLAB+SCI绘图教程敬请观看~

%% 二维柱状图的绘制模板
close all;clear all;clc;

%% 1行1列
%% 一幅图的时候figureWidth = 8.5;figureHeight = 8;调整这两个参数就可以
%定义整幅图出现的在电脑屏幕上的位置以及长和宽
%这里有必要解释一下为什么figureWidth要设置为8.5;
%因详细解释需要很长的篇幅,请转公众号观看2023-03-23的文章观看。
figureHandle = figure;
figureUnits = 'centimeters';
figureWidth = 8.5;
figureHeight = 6;
set(gcf, 'Units', figureUnits, 'Position', [0 0 figureWidth figureHeight]);

%% 定义字体和字号大小
%% 通常的SCI一般Arial字体和10字号通用
fontnamed='Arial';%字号名字
ssize=10;%字号大小
%% 如果是中文论文可以相应的更改字号名字如下
% '华文中宋' '华文仿宋' '华文宋体' '华文新魏' '华文楷体'
% '华文琥珀' '华文细黑' '华文行楷' '华文隶书' '宋体'
% '方正姚体' '微软雅黑' '方正舒体' '新宋体'
% '幼圆' '楷体' '等线' '隶书' '黑体'

%% 给定绘图颜色
load 61.mat
C1=Color(1,:)./256;
C2=Color(2,:)./256;
C3=Color(3,:)./256;
C4=Color(4,:)./256;
C5=Color(5,:)./256;
C6=Color(6,:)./256;

%% 数据准备
X = [1 2 3 4 5 6]';
Y1 = [2 4 6 2 1 2]';
Y2 = [3 4 5 2 2 1]';
Y3 = [6 5 3 6 1 1]';
Y4 = [1 2 3 4 1 2]';
Y5 = [4 3 2 1 2 1]';
Y6 = [5 5 5 4 1 2]';
Y=[Y1,Y2,Y3,Y4,Y5,Y6];

%% 绘图
h = bar(Y,'FaceColor','flat');hold on;
% 赋值颜色
for k = 1:size(Y,2)
    h(k).CData = Color(k,:)./256;
end

%% 画图的标准格式代码
% text(0.5,0.9,'(a) XXX','fontsize',ssize,'FontName',fontnamed);%,'horiz','center'
xlabel('X-axis','fontsize',ssize,'FontName',fontnamed);
ylabel('Y-axis','fontsize',ssize,'FontName',fontnamed);
axis([0 7 0 7]);%XY轴的范围
xticks([1 2 3 4 5 6]);%画格网的时候的小刻度
xticklabels({'1','2','3','4','5','6'});%加x轴刻度标注
yticks([1 2 3 4 5 6]);%画格网的时候的小刻度
yticklabels({'1','2','3','4','5','6'});%加y轴刻度标注
set(gca,'linewidth',1,'fontsize',ssize,'FontName',fontnamed);
% set(gca,'yticklabel',[]);%y轴不显示
% set(gca,'xticklabel',[]);%x轴不显示
grid on;box on;hold on;

%% 画legend
%方法一
kk=legend('L1','L2','L3','L4','L5','L6');
set(kk,'location','NorthOutside','Box', 'off','fontsize',ssize,'FontName',fontnamed);%'orientation','horizontal',
kk.NumColumns=length(h);   % 设置图例横向排列
kk.ItemTokenSize=[8,8];    % 设置图例方形大小

%方法二
% columnlegend(2,{'L1','L2','L3','L4','L5','L6'},'North');%表示一行放三个图例以及图例的位置
%% Matlab中有许多位置可以选择:
% 'North' inside plot box near top
% 'South' inside bottom
% 'East' inside right
% 'West' inside left
% 'NorthEast' inside top right (default for 2-D plots)
% 'NorthWest' inside top left
% 'SouthEast' inside bottom right
% 'SouthWest' inside bottom left
% 'NorthOutside' outside plot box near top
% 'SouthOutside' outside bottom
% 'EastOutside' outside right
% 'WestOutside' outside left
% 'NorthEastOutside' outside top right (default for 3-D plots)
% 'NorthWestOutside' outside top left
% 'SouthEastOutside' outside bottom right
% 'SouthWestOutside' outside bottom left
% 'Best' least conflict with data in plot 与绘图中的数据冲突最小
% 'BestOutside' least unused space outside plot

%% 背景颜色
set(gcf,'Color',[1 1 1])
%% 设置完毕后,按照所需分辨率、格式输出
figW = figureWidth;
figH = figureHeight;
set(figureHandle,'PaperUnits',figureUnits);
set(figureHandle,'PaperPosition',[0 0 figW figH]);
fileout = '63';
print(figureHandle,[fileout,'.png'],'-r600','-dpng');

4 【MATLAB】科研绘图第四期二维堆叠柱状图

%% Made by Lwcah(公众号:Lwcah)
%% 公众号:Lwcah
%% 知乎、B站、小红书、抖音同名账号:Lwcah,感谢关注~
%% 更多MATLAB+SCI绘图教程敬请观看~

%% 二维柱状图的绘制模板
close all;clear all;clc;

%% 1行1列
%% 一幅图的时候figureWidth = 8.5;figureHeight = 8;调整这两个参数就可以
%定义整幅图出现的在电脑屏幕上的位置以及长和宽
%这里有必要解释一下为什么figureWidth要设置为8.5;
%因详细解释需要很长的篇幅,请转公众号观看2023-03-27的文章观看。
figureHandle = figure;
figureUnits = 'centimeters';
figureWidth = 8.5;
figureHeight = 6;
set(gcf, 'Units', figureUnits, 'Position', [0 0 figureWidth figureHeight]);

%% 定义字体和字号大小
%% 通常的SCI一般Arial字体和10字号通用
fontnamed='Arial';%字号名字
ssize=10;%字号大小
%% 如果是中文论文可以相应的更改字号名字如下
% '华文中宋' '华文仿宋' '华文宋体' '华文新魏' '华文楷体'
% '华文琥珀' '华文细黑' '华文行楷' '华文隶书' '宋体'
% '方正姚体' '微软雅黑' '方正舒体' '新宋体'
% '幼圆' '楷体' '等线' '隶书' '黑体'

%% 给定绘图颜色
load 11.mat
C1=Color(1,:);
C2=Color(2,:);
C3=Color(3,:);
C4=Color(4,:);
C5=Color(5,:);
C6=Color(6,:);

%% 数据准备
X = [1 2 3 4 5 6]';
Y1 = [2 1 2 2 1 2]';
Y2 = [1 1 1 1 2 1]';
Y3 = [1 1 1 1 1 1]';
Y4 = [1 1 2 1 1 2]';
Y5 = [2 1 2 1 2 1]';
Y6 = [1 2 1 1 1 2]';
Y=[Y1,Y2,Y3,Y4,Y5,Y6];

%% 绘图
h = bar(Y,'stacked','FaceColor','flat');hold on;
% 赋值颜色
for k = 1:size(Y,2)
    h(k).CData = Color(k,:)./256;
end

%% 画图的标准格式代码
% text(0.5,0.9,'(a) XXX','fontsize',ssize,'FontName',fontnamed);%,'horiz','center'
xlabel('X-axis','fontsize',ssize,'FontName',fontnamed);
ylabel('Y-axis','fontsize',ssize,'FontName',fontnamed);
axis([0 7 0 10]);%XY轴的范围
xticks([1 2 3 4 5 6]);%画格网的时候的小刻度
xticklabels({'1','2','3','4','5','6'});%加x轴刻度标注
yticks([1 2 3 4 5 6 7 8 9 10]);%画格网的时候的小刻度
yticklabels({'1','2','3','4','5','6','7','8','9','10'});%加y轴刻度标注
set(gca,'linewidth',1,'fontsize',ssize,'FontName',fontnamed);
% set(gca,'yticklabel',[]);%y轴不显示
% set(gca,'xticklabel',[]);%x轴不显示
grid on;box on;hold on;

%% 画legend
%方法一
kk=legend('L1','L2','L3','L4','L5','L6');
set(kk,'location','NorthEast','Box', 'off','fontsize',ssize,'FontName',fontnamed);%'orientation','horizontal',
%方法二
% columnlegend(2,{'L1','L2','L3','L4','L5','L6'},'North');%表示一行放三个图例以及图例的位置
%% Matlab中有许多位置可以选择:
% 'North' inside plot box near top
% 'South' inside bottom
% 'East' inside right
% 'West' inside left
% 'NorthEast' inside top right (default for 2-D plots)
% 'NorthWest' inside top left
% 'SouthEast' inside bottom right
% 'SouthWest' inside bottom left
% 'NorthOutside' outside plot box near top
% 'SouthOutside' outside bottom
% 'EastOutside' outside right
% 'WestOutside' outside left
% 'NorthEastOutside' outside top right (default for 3-D plots)
% 'NorthWestOutside' outside top left
% 'SouthEastOutside' outside bottom right
% 'SouthWestOutside' outside bottom left
% 'Best' least conflict with data in plot 与绘图中的数据冲突最小
% 'BestOutside' least unused space outside plot

%% 背景颜色
set(gcf,'Color',[1 1 1])
%% 设置完毕后,按照所需分辨率、格式输出
figW = figureWidth;
figH = figureHeight;
set(figureHandle,'PaperUnits',figureUnits);
set(figureHandle,'PaperPosition',[0 0 figW figH]);
fileout = '13';
print(figureHandle,[fileout,'.png'],'-r600','-dpng');

5 【MATLAB】科研绘图第五期二维横轴柱状图

%% Made by Lwcah(公众号:Lwcah)
%% 公众号:Lwcah
%% 知乎、B站、小红书、抖音同名账号:Lwcah,感谢关注~
%% 更多MATLAB+SCI绘图教程敬请观看~

%% 二维柱状图的绘制模板
close all;clear all;clc;

%% 1行1列
%% 一幅图的时候figureWidth = 8.5;figureHeight = 8;调整这两个参数就可以
%定义整幅图出现的在电脑屏幕上的位置以及长和宽
%这里有必要解释一下为什么figureWidth要设置为8.5;
%因详细解释需要很长的篇幅,请转公众号观看该天的文章。
figureHandle = figure;
figureUnits = 'centimeters';
figureWidth = 8.5;
figureHeight = 6;
set(gcf, 'Units', figureUnits, 'Position', [0 0 figureWidth figureHeight]);

%% 定义字体和字号大小
%% 通常的SCI一般Arial字体和10字号通用
fontnamed='Arial';%字号名字
ssize=10;%字号大小
%% 如果是中文论文可以相应的更改字号名字如下
% '华文中宋' '华文仿宋' '华文宋体' '华文新魏' '华文楷体'
% '华文琥珀' '华文细黑' '华文行楷' '华文隶书' '宋体'
% '方正姚体' '微软雅黑' '方正舒体' '新宋体'
% '幼圆' '楷体' '等线' '隶书' '黑体'

%% 给定绘图颜色
load 11.mat
C1=Color(1,:);
C2=Color(2,:);
C3=Color(3,:);
C4=Color(4,:);
C5=Color(5,:);
C6=Color(6,:);

%% 数据准备
X = [1 2 3 4 5 6]';
Y1 = [2 4 6 2 1 2]';
Y2 = [3 4 5 2 2 1]';
Y3 = [6 5 3 6 1 1]';
Y4 = [1 2 3 4 1 2]';
Y5 = [4 3 2 1 2 1]';
Y6 = [5 5 5 4 1 2]';
Y=[Y1,Y2,Y3,Y4,Y5,Y6];

%% 绘图
h = barh(Y,'FaceColor','flat');hold on;%'stacked',
% 赋值颜色
for k = 1:size(Y,2)
    h(k).CData = Color(k,:)./256;
end

%% 画图的标准格式代码
% text(0.5,0.9,'(a) XXX','fontsize',ssize,'FontName',fontnamed);%,'horiz','center'
xlabel('X-axis','fontsize',ssize,'FontName',fontnamed);
ylabel('Y-axis','fontsize',ssize,'FontName',fontnamed);
axis([0 7 0 7]);%XY轴的范围
xticks([1 2 3 4 5 6]);%画格网的时候的小刻度
xticklabels({'1','2','3','4','5','6'});%加x轴刻度标注
yticks([1 2 3 4 5 6]);%画格网的时候的小刻度
yticklabels({'1','2','3','4','5','6'});%加y轴刻度标注
set(gca,'linewidth',1,'fontsize',ssize,'FontName',fontnamed);
% set(gca,'yticklabel',[]);%y轴不显示
% set(gca,'xticklabel',[]);%x轴不显示
grid on;box on;hold on;

%% 画legend
%方法一
kk=legend('L1','L2','L3','L4','L5','L6');
set(kk,'location','NorthEast','Box', 'off','fontsize',ssize,'FontName',fontnamed);%'orientation','horizontal',
%方法二
% columnlegend(2,{'L1','L2','L3','L4','L5','L6'},'North');%表示一行放三个图例以及图例的位置
%% Matlab中有许多位置可以选择:
% 'North' inside plot box near top
% 'South' inside bottom
% 'East' inside right
% 'West' inside left
% 'NorthEast' inside top right (default for 2-D plots)
% 'NorthWest' inside top left
% 'SouthEast' inside bottom right
% 'SouthWest' inside bottom left
% 'NorthOutside' outside plot box near top
% 'SouthOutside' outside bottom
% 'EastOutside' outside right
% 'WestOutside' outside left
% 'NorthEastOutside' outside top right (default for 3-D plots)
% 'NorthWestOutside' outside top left
% 'SouthEastOutside' outside bottom right
% 'SouthWestOutside' outside bottom left
% 'Best' least conflict with data in plot 与绘图中的数据冲突最小
% 'BestOutside' least unused space outside plot

%% 背景颜色
set(gcf,'Color',[1 1 1])
%% 设置完毕后,按照所需分辨率、格式输出
figW = figureWidth;
figH = figureHeight;
set(figureHandle,'PaperUnits',figureUnits);
set(figureHandle,'PaperPosition',[0 0 figW figH]);
fileout = '13';
print(figureHandle,[fileout,'.png'],'-r600','-dpng');

6 【MATLAB】科研绘图第六期三维折线图

%% Made by Lwcah(公众号:Lwcah)
%% 公众号:Lwcah
%% 知乎、B站、小红书、抖音同名账号:Lwcah,感谢关注~
%% 更多MATLAB+SCI绘图教程敬请观看~

%% 绘制模板
close all;clear all;clc;

%% 1行1列
%% 一幅图的时候figureWidth = 8.5;figureHeight = 8;调整这两个参数就可以
%定义整幅图出现的在电脑屏幕上的位置以及长和宽
%这里有必要解释一下为什么figureWidth要设置为8.5;
%因详细解释需要很长的篇幅,请转公众号观看该天的文章。
figureHandle = figure;
figureUnits = 'centimeters';
figureWidth = 8.5;
figureHeight = 6;
set(gcf, 'Units', figureUnits, 'Position', [28 20 figureWidth figureHeight]);
% 注:28代表出图时图的左下角相对于整个电脑屏幕的左下角向左偏移28个单位,向上偏移20个单位。
% 可自行调节两个数字让图出在自己屏幕的某个位置

%% 定义字体和字号大小
%% 通常的SCI一般Arial字体和10字号通用
fontnamed='Arial';%字号名字
ssize=10;%字号大小
%% 如果是中文论文可以相应的更改字号名字如下
% '华文中宋' '华文仿宋' '华文宋体' '华文新魏' '华文楷体'
% '华文琥珀' '华文细黑' '华文行楷' '华文隶书' '宋体'
% '方正姚体' '微软雅黑' '方正舒体' '新宋体'
% '幼圆' '楷体' '等线' '隶书' '黑体'

%% 数据准备
% X定义第几行的数据,Y定义的数据要按升序排列
X = [1 1 1 1 1 1
    2 2 2 2 2 2
    3 3 3 3 3 3
    4 4 4 4 4 4
    5 5 5 5 5 5
    6 6 6 6 6 6]';
Y = [0.1 0.2 0.3 0.4 0.5 0.6
    0.1 0.2 0.3 0.4 0.5 0.6 
    0.1 0.2 0.3 0.4 0.5 0.6
    0.1 0.2 0.3 0.4 0.5 0.6 
    0.1 0.2 0.3 0.4 0.5 0.6 
    0.1 0.2 0.3 0.4 0.5 0.6]';
Z = [100 200 100 100 100 100
    100 200 100 100 100 100
    100 100 200 100 100 100
    100 100 100 200 100 100
    100 100 100 100 200 100
    100 100 100 100 200 100]';

%% 绘图
plot3(X,Y,Z,'linewidth',1);
hTitle = title('Three-dimensional line chart');
hXLabel = xlabel('X');
hYLabel = ylabel('Y');
hZLabel = zlabel('Z');

%% 画图的标准格式代码
% text(0.5,0.9,'(a) XXX','fontsize',ssize,'FontName',fontnamed);%,'horiz','center'
xlabel('X-axis','fontsize',ssize,'FontName',fontnamed);
ylabel('Y-axis','fontsize',ssize,'FontName',fontnamed);
zlabel('Z-axis','fontsize',ssize,'FontName',fontnamed);
axis([0 7 0 0.7 50 250]);%XYZ轴的范围
xticks([1 2 3 4 5 6]);%画格网的时候的小刻度
xticklabels({'1','2','3','4','5','6'});%加x轴刻度标注
yticks([0.1 0.2 0.3 0.4 0.5 0.6]);%画格网的时候的小刻度
yticklabels({'0.1','0.2','0.3','0.4','0.5','0.6'});%加y轴刻度标注
zticks([50 100 150 200 250]);%画格网的时候的小刻度
zticklabels({'50','100','150','200','250'});%加z轴刻度标注
set(gca,'linewidth',1,'fontsize',ssize,'FontName',fontnamed);
% set(gca,'zticklabel',[]);%z轴不显示
% set(gca,'yticklabel',[]);%y轴不显示
% set(gca,'xticklabel',[]);%x轴不显示
grid on;box on;hold on;

%% 画legend
%方法一
kk=legend('L1','L2','L3','L4','L5','L6');
set(kk,'location','NorthEast','Box', 'off','fontsize',ssize,'FontName',fontnamed);%'orientation','horizontal',
%方法二
% columnlegend(2,{'L1','L2','L3','L4','L5','L6'},'North');%表示一行放三个图例以及图例的位置
%% Matlab中有许多位置可以选择:
% 'North' inside plot box near top
% 'South' inside bottom
% 'East' inside right
% 'West' inside left
% 'NorthEast' inside top right (default for 2-D plots)
% 'NorthWest' inside top left
% 'SouthEast' inside bottom right
% 'SouthWest' inside bottom left
% 'NorthOutside' outside plot box near top
% 'SouthOutside' outside bottom
% 'EastOutside' outside right
% 'WestOutside' outside left
% 'NorthEastOutside' outside top right (default for 3-D plots)
% 'NorthWestOutside' outside top left
% 'SouthEastOutside' outside bottom right
% 'SouthWestOutside' outside bottom left
% 'Best' least conflict with data in plot 与绘图中的数据冲突最小
% 'BestOutside' least unused space outside plot

%% 背景颜色
set(gcf,'Color',[1 1 1])
%% 设置完毕后,按照所需分辨率、格式输出
figW = figureWidth;
figH = figureHeight;
set(figureHandle,'PaperUnits',figureUnits);
set(figureHandle,'PaperPosition',[0 0 figW figH]);
fileout = '三维折线图';
print(figureHandle,[fileout,'.png'],'-r600','-dpng');

7 【MATLAB】科研绘图第七期二维横轴堆叠柱状图

%% Made by Lwcah(公众号:Lwcah)
%% 公众号:Lwcah
%% 知乎、B站、小红书、抖音同名账号:Lwcah,感谢关注~
%% 更多MATLAB+SCI绘图教程敬请观看~

%% 清除变量
close all;clear all;clc;

%% 1行1列
%% 一幅图的时候figureWidth = 8.5;figureHeight = 8;调整这两个参数就可以
%定义整幅图出现的在电脑屏幕上的位置以及长和宽
%这里有必要解释一下为什么figureWidth要设置为8.5;
%因详细解释需要很长的篇幅,请转公众号观看该天的文章。
figureHandle = figure;
figureUnits = 'centimeters';
figureWidth = 8.5;
figureHeight = 6;
set(gcf, 'Units', figureUnits, 'Position', [28 20 figureWidth figureHeight]);
% 注:28代表出图时图的左下角相对于整个电脑屏幕的左下角向左偏移28个单位,向上偏移20个单位。
% 可自行调节两个数字让图出在自己屏幕的某个位置

%% 定义字体和字号大小
%% 通常的SCI一般Arial字体和10字号通用
fontnamed='Arial';%字号名字
ssize=10;%字号大小
%% 如果是中文论文可以相应的更改字号名字如下
% '华文中宋' '华文仿宋' '华文宋体' '华文新魏' '华文楷体'
% '华文琥珀' '华文细黑' '华文行楷' '华文隶书' '宋体'
% '方正姚体' '微软雅黑' '方正舒体' '新宋体'
% '幼圆' '楷体' '等线' '隶书' '黑体'

%% 给定绘图颜色
load 61.mat
C1=Color(1,:);
C2=Color(2,:);
C3=Color(3,:);
C4=Color(4,:);
C5=Color(5,:);
C6=Color(6,:);

%% 数据准备
X = [1 2 3 4 5 6]';
Y1 = [2 1 2 2 1 2]';
Y2 = [1 1 1 1 2 1]';
Y3 = [1 1 1 1 1 1]';
Y4 = [1 1 2 1 1 2]';
Y5 = [2 1 2 1 2 1]';
Y6 = [1 2 1 1 1 2]';
Y=[Y1,Y2,Y3,Y4,Y5,Y6];

%% 绘图
h = barh(Y,'stacked','FaceColor','flat');hold on;%
% 赋值颜色
for k = 1:size(Y,2)
    h(k).CData = Color(k,:)./256;
end

%% 画图的标准格式代码
% text(0.5,0.9,'(a) XXX','fontsize',ssize,'FontName',fontnamed);%,'horiz','center'
xlabel('X-axis','fontsize',ssize,'FontName',fontnamed);
ylabel('Y-axis','fontsize',ssize,'FontName',fontnamed);
axis([0 10 0 7]);%XY轴的范围
xticks([1 2 3 4 5 6 7 8 9 10]);%画格网的时候的小刻度
xticklabels({'1','2','3','4','5','6','7','8','9','10'});%加x轴刻度标注
yticks([1 2 3 4 5 6]);%画格网的时候的小刻度
yticklabels({'1','2','3','4','5','6'});%加y轴刻度标注
set(gca,'linewidth',1,'fontsize',ssize,'FontName',fontnamed);
% set(gca,'yticklabel',[]);%y轴不显示
% set(gca,'xticklabel',[]);%x轴不显示
grid on;box on;hold on;

%% 画legend
%方法一
kk=legend('L1','L2','L3','L4','L5','L6');
set(kk,'location','NorthEast','Box', 'off','fontsize',ssize,'FontName',fontnamed);%'orientation','horizontal',
%方法二
% columnlegend(2,{'L1','L2','L3','L4','L5','L6'},'North');%表示一行放三个图例以及图例的位置
%% Matlab中有许多位置可以选择:
% 'North' inside plot box near top
% 'South' inside bottom
% 'East' inside right
% 'West' inside left
% 'NorthEast' inside top right (default for 2-D plots)
% 'NorthWest' inside top left
% 'SouthEast' inside bottom right
% 'SouthWest' inside bottom left
% 'NorthOutside' outside plot box near top
% 'SouthOutside' outside bottom
% 'EastOutside' outside right
% 'WestOutside' outside left
% 'NorthEastOutside' outside top right (default for 3-D plots)
% 'NorthWestOutside' outside top left
% 'SouthEastOutside' outside bottom right
% 'SouthWestOutside' outside bottom left
% 'Best' least conflict with data in plot 与绘图中的数据冲突最小
% 'BestOutside' least unused space outside plot

%% 背景颜色
set(gcf,'Color',[1 1 1])
%% 设置完毕后,按照所需分辨率、格式输出
figW = figureWidth;
figH = figureHeight;
set(figureHandle,'PaperUnits',figureUnits);
set(figureHandle,'PaperPosition',[0 0 figW figH]);
fileout = '63';
print(figureHandle,[fileout,'.png'],'-r600','-dpng');

8 【MATLAB】科研绘图第八期点线图

%% Made by Lwcah (公众号:Lwcah)
%% 公众号:Lwcah
%% 知乎、B站、小红书、抖音同名账号:Lwcah,感谢关注~
%% 更多MATLAB+SCI绘图教程敬请观看~

%% 清除变量
close all;clear all;clc;

%% 2行1列
%% 一幅图的时候figureWidth = 8.5;figureHeight = 8;调整这两个参数就可以
%定义整幅图出现的在电脑屏幕上的位置以及长和宽
%这里有必要解释一下为什么figureWidth要设置为8.5;
%因详细解释需要很长的篇幅,请转公众号观看该天的文章。
figureHandle = figure;
figureUnits = 'centimeters';
figureWidth = 8.5;
figureHeight = 8;
set(gcf, 'Units', figureUnits, 'Position', [28 20 figureWidth figureHeight]);
% 注:28代表出图时图的左下角相对于整个电脑屏幕的左下角向左偏移28个单位,向上偏移20个单位。
% 可自行调节两个数字让图出在自己屏幕的某个位置
hold on;

%% 定义2幅子图在图中的x,y以及长和宽
pos21 = zeros(2,1);
pos21(:,3) = 0.80;%长
pos21(:,4) = 0.36;%宽
pos21(1,2) = 0.53;%y
pos21(2,2) = 0.14;%y
pos21(:,1) = 0.12;%x
% subplot('position',pos21(1,:));
% subplot('position',pos21(2,:));

%% 定义字体和字号大小
%% 通常的SCI一般Arial字体和10字号通用
fontnamed='Arial';%字号名字
ssize=10;%字号大小
%% 如果是中文论文可以相应的更改字号名字如下
% '华文中宋' '华文仿宋' '华文宋体' '华文新魏' '华文楷体'
% '华文琥珀' '华文细黑' '华文行楷' '华文隶书' '宋体'
% '方正姚体' '微软雅黑' '方正舒体' '新宋体'
% '幼圆' '楷体' '等线' '隶书' '黑体'

%% 给定绘图颜色
load 61.mat
C1=Color(1,:)./256;
C2=Color(2,:)./256;
C3=Color(3,:)./256;
C4=Color(4,:)./256;
C5=Color(5,:)./256;
C6=Color(6,:)./256;

%% 画第1幅子图
subplot('position',pos21(1,:));
%% 数据准备
x=[1;2;3;4;5;6];
y1=[1;1;1;1;1;1];
y2=[2;2;2;2;2;2];
y3=[3;3;3;3;3;3];
y4=[4;4;4;4;4;4];
y5=[5;5;5;5;5;5];
y6=[6;6;6;6;6;6];

%% 绘图
h1 = line (x,y1,'LineStyle','--','Marker','o','LineWidth',1,'Color',C1, 'MarkerEdgeColor',C1,'MarkerFaceColor',C1);hold on;
h2 = line (x,y2,'LineStyle','--','Marker','o','LineWidth',1,'Color',C2, 'MarkerEdgeColor',C2,'MarkerFaceColor',C2);hold on;
h3 = line (x,y3,'LineStyle','--','Marker','o','LineWidth',1,'Color',C3, 'MarkerEdgeColor',C3,'MarkerFaceColor',C3);hold on;
h4 = line (x,y4,'LineStyle','--','Marker','o','LineWidth',1,'Color',C4, 'MarkerEdgeColor',C4,'MarkerFaceColor',C4);hold on;
h5 = line (x,y5,'LineStyle','--','Marker','o','LineWidth',1,'Color',C5, 'MarkerEdgeColor',C5,'MarkerFaceColor',C5);hold on;
h6 = line (x,y6,'LineStyle','--','Marker','o','LineWidth',1,'Color',C6, 'MarkerEdgeColor',C6,'MarkerFaceColor',C6);hold on;
%% 定义线型、标记符
% 线型: -    --      :     :.  
% 表示:实线 双划线  虚线  点划线 
% 标记符:  +    o     *     .     x    s    d     ^      v     >     <  
% 表示:  加号 空心圆  星号 实心圆 叉号 正方形 菱形 上三角 下三角 左三角 右三角 

%% 画图的标准格式代码
% text(0.5,0.9,'(a) XXX','fontsize',ssize,'FontName',fontnamed);%,'horiz','center'
% xlabel('X-axis','fontsize',ssize,'FontName',fontnamed);
ylabel('Y-axis','fontsize',ssize,'FontName',fontnamed);
axis([0 7 0 7]);%XY轴的范围
xticks([1 2 3 4 5 6 7]);%画格网的时候的小刻度
xticklabels({});%加x轴刻度标注
yticks([1 2 3 4 5 6]);%画格网的时候的小刻度
yticklabels({'1','2','3','4','5','6'});%加y轴刻度标注
set(gca,'linewidth',1,'fontsize',ssize,'FontName',fontnamed);
% set(gca,'yticklabel',[]);%y轴不显示
% set(gca,'xticklabel',[]);%x轴不显示
grid on;box on;hold on;

%% 画legend
% kk=legend('L1','L2','L3','L4','L5','L6');
%方法一
kk=legend([h1,h2,h3],'L1','L2','L3');
set(kk,'location','NorthEast','Box', 'off','fontsize',ssize,'orientation','horizontal','FontName',fontnamed);%
%方法二
% columnlegend(2,{'L1','L2','L3','L4','L5','L6'},'North');%表示一行放三个图例以及图例的位置
%% Matlab中有许多位置可以选择:
% 'North' inside plot box near top
% 'South' inside bottom
% 'East' inside right
% 'West' inside left
% 'NorthEast' inside top right (default for 2-D plots)
% 'NorthWest' inside top left
% 'SouthEast' inside bottom right
% 'SouthWest' inside bottom left
% 'NorthOutside' outside plot box near top
% 'SouthOutside' outside bottom
% 'EastOutside' outside right
% 'WestOutside' outside left
% 'NorthEastOutside' outside top right (default for 3-D plots)
% 'NorthWestOutside' outside top left
% 'SouthEastOutside' outside bottom right
% 'SouthWestOutside' outside bottom left
% 'Best' least conflict with data in plot 与绘图中的数据冲突最小
% 'BestOutside' least unused space outside plot

%% 画第2幅子图
subplot('position',pos21(2,:));
%% 数据准备
x=[1;2;3;4;5;6];
y1=[1;1;1;1;1;1];
y2=[2;2;2;2;2;2];
y3=[3;3;3;3;3;3];
y4=[4;4;4;4;4;4];
y5=[5;5;5;5;5;5];
y6=[6;6;6;6;6;6];

%% 绘图
h1 = line (x,y1,'LineStyle','--','Marker','o','LineWidth',1,'Color',C1, 'MarkerEdgeColor',C1,'MarkerFaceColor',C1);hold on;
h2 = line (x,y2,'LineStyle','--','Marker','o','LineWidth',1,'Color',C2, 'MarkerEdgeColor',C2,'MarkerFaceColor',C2);hold on;
h3 = line (x,y3,'LineStyle','--','Marker','o','LineWidth',1,'Color',C3, 'MarkerEdgeColor',C3,'MarkerFaceColor',C3);hold on;
h4 = line (x,y4,'LineStyle','--','Marker','o','LineWidth',1,'Color',C4, 'MarkerEdgeColor',C4,'MarkerFaceColor',C4);hold on;
h5 = line (x,y5,'LineStyle','--','Marker','o','LineWidth',1,'Color',C5, 'MarkerEdgeColor',C5,'MarkerFaceColor',C5);hold on;
h6 = line (x,y6,'LineStyle','--','Marker','o','LineWidth',1,'Color',C6, 'MarkerEdgeColor',C6,'MarkerFaceColor',C6);hold on;

%% 画图的标准格式代码
% text(0.5,0.9,'(a) XXX','fontsize',ssize,'FontName',fontnamed);%,'horiz','center'
xlabel('X-axis','fontsize',ssize,'FontName',fontnamed);
ylabel('Y-axis','fontsize',ssize,'FontName',fontnamed);
axis([0 7 0 7]);%XY轴的范围
xticks([1 2 3 4 5 6 7]);%画格网的时候的小刻度
xticklabels({'1','2','3','4','5','6','7'});%加x轴刻度标注
yticks([1 2 3 4 5 6]);%画格网的时候的小刻度
yticklabels({'1','2','3','4','5','6'});%加y轴刻度标注
set(gca,'linewidth',1,'fontsize',ssize,'FontName',fontnamed);
% set(gca,'yticklabel',[]);%y轴不显示
% set(gca,'xticklabel',[]);%x轴不显示
grid on;box on;hold on;

%% 画legend
kk=legend([h4,h5,h6],'L4','L5','L6');
set(kk,'location','NorthEast','Box', 'off','fontsize',ssize,'orientation','horizontal','FontName',fontnamed);%


%% 背景颜色
set(gcf,'Color',[1 1 1])
%% 设置完毕后,按照所需分辨率、格式输出
figW = figureWidth;
figH = figureHeight;
set(figureHandle,'PaperUnits',figureUnits);
set(figureHandle,'PaperPosition',[0 0 figW figH]);
fileout = '63';
print(figureHandle,[fileout,'.png'],'-r600','-dpng');

9 【MATLAB】科研绘图第九期带高斯分布的直方图

%% 带高斯分布的直方图(Histogram with Gaussian distribution)

%% Made by Lwcah(公众号:Lwcah)
%% 公众号:Lwcah
%% 知乎、B站、小红书、抖音同名账号:Lwcah,感谢关注~
%% 更多MATLAB+SCI绘图教程敬请观看~

%% 清除变量
close all;clear all;clc;

%% 1行1列
%% 一幅图的时候figureWidth = 8.5;figureHeight = 8;调整这两个参数就可以
%定义整幅图出现的在电脑屏幕上的位置以及长和宽
%这里有必要解释一下为什么figureWidth要设置为8.5;
%因详细解释需要很长的篇幅,请转公众号观看该天的文章。
figureHandle = figure;
figureUnits = 'centimeters';
figureWidth = 8.5;
figureHeight = 6;
set(gcf, 'Units', figureUnits, 'Position', [28 20 figureWidth figureHeight]);
% 注:28代表出图时图的左下角相对于整个电脑屏幕的左下角向左偏移28个单位,向上偏移20个单位。
% 可自行调节两个数字让图出在自己屏幕的某个位置

%% 定义字体和字号大小
%% 通常的SCI一般Arial字体和10字号通用
fontnamed='Arial';%字号名字
ssize=10;%字号大小
%% 如果是中文论文可以相应的更改字号名字如下
% '华文中宋' '华文仿宋' '华文宋体' '华文新魏' '华文楷体'
% '华文琥珀' '华文细黑' '华文行楷' '华文隶书' '宋体'
% '方正姚体' '微软雅黑' '方正舒体' '新宋体'
% '幼圆' '楷体' '等线' '隶书' '黑体'

%% 给定绘图颜色
C1 = chinesecolors(4);%香叶红
C2 = chinesecolors(232);%粉绿
% C3 = chinesecolors(12);%合欢红
% C4 = chinesecolors(17);%鹅冠红

%% 数据
x = 0:0.5:10;
y = gaussmf(x,[2 5]);% gaussmf(X,[Sigma,Mu]);gaussmf(X,[标准差,平均值])

%% 绘图
h1=bar(x, y, 'EdgeColor', 'none', 'BarWidth', 1,'FaceColor',C1);hold on;
h2=plot(x,y,'LineStyle','--','Marker','o','LineWidth',1,'Color',C2, 'MarkerEdgeColor',C2,'MarkerFaceColor',C2);hold on;

%% 修图的标准格式代码
% text(0.5,0.9,'(a) XXX','fontsize',ssize,'FontName',fontnamed);%,'horiz','center'
xlabel('X-axis','fontsize',ssize,'FontName',fontnamed);
ylabel('Y-axis','fontsize',ssize,'FontName',fontnamed);
% axis([0 10 0 7]);%XY轴的范围
% xticks([1 2 3 4 5 6 7 8 9 10]);%画格网的时候的小刻度
% xticklabels({'1','2','3','4','5','6','7','8','9','10'});%加x轴刻度标注
% yticks([1 2 3 4 5 6]);%画格网的时候的小刻度
% yticklabels({'1','2','3','4','5','6'});%加y轴刻度标注
set(gca,'linewidth',1,'fontsize',ssize,'FontName',fontnamed);
% set(gca,'yticklabel',[]);%y轴不显示
% set(gca,'xticklabel',[]);%x轴不显示
grid on;box on;hold on;

%% 画legend
%方法一
kk=legend('h1','h2');
set(kk,'location','NorthEast','Box', 'off','fontsize',ssize,'FontName',fontnamed);%'orientation','horizontal',
%方法二
% columnlegend(2,{'L1','L2','L3','L4','L5','L6'},'North');%表示一行放三个图例以及图例的位置

%% Matlab中有许多位置可以选择:
% 'North' inside plot box near top
% 'South' inside bottom
% 'East' inside right
% 'West' inside left
% 'NorthEast' inside top right (default for 2-D plots)
% 'NorthWest' inside top left
% 'SouthEast' inside bottom right
% 'SouthWest' inside bottom left
% 'NorthOutside' outside plot box near top
% 'SouthOutside' outside bottom
% 'EastOutside' outside right
% 'WestOutside' outside left
% 'NorthEastOutside' outside top right (default for 3-D plots)
% 'NorthWestOutside' outside top left
% 'SouthEastOutside' outside bottom right
% 'SouthWestOutside' outside bottom left
% 'Best' least conflict with data in plot 与绘图中的数据冲突最小
% 'BestOutside' least unused space outside plot

%% 背景颜色
set(gcf,'Color',[1 1 1])
%% 设置完毕后,按照所需分辨率、格式输出
figW = figureWidth;
figH = figureHeight;
set(figureHandle,'PaperUnits',figureUnits);
set(figureHandle,'PaperPosition',[0 0 figW figH]);
fileout = 'demo_histogram_gaussian';
print(figureHandle,[fileout,'.png'],'-r600','-dpng');

10 【MATLAB】科研绘图第十期四象限的正弦图

%% 四象限的正弦图 (Sine diagram of four quadrants)

%% Made by Lwcah(公众号:Lwcah)
%% 公众号:Lwcah
%% 知乎、B站、小红书、抖音同名账号:Lwcah,感谢关注~
%% 更多MATLAB+SCI绘图教程敬请观看~

clear;clc;close all;
%% 给定绘图颜色
C1 = chinesecolors(148);%海涛蓝
C2 = chinesecolors(516);%覆盆子红
% C3 = chinesecolors(12);%合欢红
% C4 = chinesecolors(17);%鹅冠红

%% 定义字体和字号大小
%% 通常的SCI一般Arial字体和10字号通用
fontnamed='Arial';%字号名字
ssize=10;%字号大小
%% 如果是中文论文可以相应的更改字号名字如下
% '华文中宋' '华文仿宋' '华文宋体' '华文新魏' '华文楷体'
% '华文琥珀' '华文细黑' '华文行楷' '华文隶书' '宋体'
% '方正姚体' '微软雅黑' '方正舒体' '新宋体'
% '幼圆' '楷体' '等线' '隶书' '黑体'

%% 1行1列
%% 一幅图的时候figureWidth = 8.5;figureHeight = 8;调整这两个参数就可以
%定义整幅图出现的在电脑屏幕上的位置以及长和宽
%这里有必要解释一下为什么figureWidth要设置为8.5;
%因详细解释需要很长的篇幅,请转公众号观看该天的文章。
figureHandle = figure;
figureUnits = 'centimeters';
figureWidth = 8.5;
figureHeight = 6;
set(gcf, 'Units', figureUnits, 'Position', [28 20 figureWidth figureHeight]);
% 注:28代表出图时图的左下角相对于整个电脑屏幕的左下角向左偏移28个单位,向上偏移20个单位。
% 可自行调节两个数字让图出在自己屏幕的某个位置

%% 数据
syms t
n = 60;
x = linspace(-pi,pi,n);y = sin(x);
ax = axes;

%% 绘图
h1=plot(ax,x,y,'LineStyle','--','Marker','o','LineWidth',1,'Color',C2, 'MarkerEdgeColor',C2,'MarkerFaceColor',C2);hold on% 绘制正弦曲线
PlotLineArrow(ax, [-2*pi, 2*pi], [0, 0], 'none', 'k', 1);hold on%x轴带箭头   
PlotLineArrow(ax, [0, 0], [-2, 2], 'none', 'k', 1);hold on%y轴带箭头    

%% 标注点
text(-pi,0.2,'(-\pi, 0)');
text(pi,-0.2,'(\pi, 0)');
text(0.1,-0.1, '(0, 0)');

%% 修图的标准格式代码
% text(0.5,0.9,'(a) XXX','fontsize',ssize,'FontName',fontnamed);%,'horiz','center'
% xlabel('X-axis','fontsize',ssize,'FontName',fontnamed);
% ylabel('Y-axis','fontsize',ssize,'FontName',fontnamed);
% axis([0 10 0 7]);%XY轴的范围
% xticks([1 2 3 4 5 6 7 8 9 10]);%画格网的时候的小刻度
% xticklabels({'1','2','3','4','5','6','7','8','9','10'});%加x轴刻度标注
% yticks([1 2 3 4 5 6]);%画格网的时候的小刻度
% yticklabels({'1','2','3','4','5','6'});%加y轴刻度标注
set(gca,'linewidth',1,'fontsize',ssize,'FontName',fontnamed);
% set(gca,'yticklabel',[]);%y轴不显示
% set(gca,'xticklabel',[]);%x轴不显示
grid on;box on;hold on;

%% 画legend
%方法一
kk=legend('h1');
set(kk,'location','NorthEast','Box', 'off','fontsize',ssize,'FontName',fontnamed);%'orientation','horizontal',
%方法二
% columnlegend(2,{'L1','L2','L3','L4','L5','L6'},'North');%表示一行放三个图例以及图例的位置

%% Matlab中有许多位置可以选择:
% 'North' inside plot box near top
% 'South' inside bottom
% 'East' inside right
% 'West' inside left
% 'NorthEast' inside top right (default for 2-D plots)
% 'NorthWest' inside top left
% 'SouthEast' inside bottom right
% 'SouthWest' inside bottom left
% 'NorthOutside' outside plot box near top
% 'SouthOutside' outside bottom
% 'EastOutside' outside right
% 'WestOutside' outside left
% 'NorthEastOutside' outside top right (default for 3-D plots)
% 'NorthWestOutside' outside top left
% 'SouthEastOutside' outside bottom right
% 'SouthWestOutside' outside bottom left
% 'Best' least conflict with data in plot 与绘图中的数据冲突最小
% 'BestOutside' least unused space outside plot

%% 背景颜色
set(gcf,'Color',[1 1 1])
%% 设置完毕后,按照所需分辨率、格式输出
figW = figureWidth;
figH = figureHeight;
set(figureHandle,'PaperUnits',figureUnits);
set(figureHandle,'PaperPosition',[0 0 figW figH]);
fileout = 'demo_XYaxis';
print(figureHandle,[fileout,'.png'],'-r600','-dpng');

11 【MATLAB】科研绘图第十一期动态趋势图

%% 动态趋势图(Dynamic trend chart)

%% Made by Lwcah (公众号:Lwcah)
%% 公众号:Lwcah
%% 知乎、B站、小红书、抖音同名账号:Lwcah,感谢关注~
%% 更多MATLAB+SCI绘图教程敬请观看~

%% 清除变量
close all;clear all;clc;

%% 1行1列
%% 一幅图的时候figureWidth = 8.5;figureHeight = 8;调整这两个参数就可以
%定义整幅图出现的在电脑屏幕上的位置以及长和宽
%这里有必要解释一下为什么figureWidth要设置为8.5;
%因详细解释需要很长的篇幅,请转公众号观看该天的文章。
figureHandle = figure;
figureUnits = 'centimeters';
figureWidth = 8.5;
figureHeight = 6;
set(gcf, 'Units', figureUnits, 'Position', [28 20 figureWidth figureHeight]);
% 注:28代表出图时图的左下角相对于整个电脑屏幕的左下角向左偏移28个单位,向上偏移20个单位。
% 可自行调节两个数字让图出在自己屏幕的某个位置

%% 定义字体和字号大小
%% 通常的SCI一般Arial字体和10字号通用
fontnamed='华文中宋';%字号名字Arial
ssize=10;%字号大小
%% 如果是中文论文可以相应的更改字号名字如下
% '华文中宋' '华文仿宋' '华文宋体' '华文新魏' '华文楷体'
% '华文琥珀' '华文细黑' '华文行楷' '华文隶书' '宋体'
% '方正姚体' '微软雅黑' '方正舒体' '新宋体'
% '幼圆' '楷体' '等线' '隶书' '黑体'

%% 给定绘图颜色
C1 = chinesecolors(343);%香水玫瑰
C2 = chinesecolors(150);%靛青
C3 = chinesecolors(523);%玫瑰灰
% C4 = chinesecolors(17);%鹅冠红

%% 数据
data_tp=xlsread('data_tp.xlsx');%excel中的五列数据分别为年、月、日、潮位数据和排序
y = data_tp(1:265,4);%选取第四列数据
len = length(y);
x = 1:len;

%% 背景颜色
set(gcf,'Color',[1 1 1]);
%% 修图的标准格式代码
% text(0.5,0.9,'(a) XXX','fontsize',ssize,'FontName',fontnamed);%,'horiz','center'
xlabel('X-axis','fontsize',ssize,'FontName',fontnamed);
ylabel('Y-axis','fontsize',ssize,'FontName',fontnamed);
% axis([0 10 0 7]);%XY轴的范围
% xticks([1 2 3 4 5 6 7 8 9 10]);%画格网的时候的小刻度
% xticklabels({'1','2','3','4','5','6','7','8','9','10'});%加x轴刻度标注
% yticks([1 2 3 4 5 6]);%画格网的时候的小刻度
% yticklabels({'1','2','3','4','5','6'});%加y轴刻度标注
set(gca,'linewidth',1,'fontsize',ssize,'FontName',fontnamed);
% set(gca,'yticklabel',[]);%y轴不显示
% set(gca,'xticklabel',[]);%x轴不显示
grid on;box on;hold on;

%% 绘图
%% 第一个点为标记点
plot(x(1), y(1), 'o', 'Color', C1, 'MarkerSize', 10, 'MarkerFaceColor', C1);hold on;
MakeGif('demo_dynamic_trend.Gif',1);hold on;%保存gif动态图
%% 循环画图
for i = 2:len
    plot(x(i-1:i), y(i-1:i), 'Color', C2, 'LineWidth', 1);hold on;% 画两个点
    axis([0 365 182.7 183.5]);%XY轴的范围
    delete(findobj('Type','text'));% 删掉文本
    delete(findobj('Marker','o'));% 删掉标记
    plot(x(i),y(i),'o','Color',C3,'MarkerSize',5,'MarkerFaceColor',C3);hold on;% 画标记点
    text(x(i),y(i),['  潮位:', num2str(y(i))], 'Color',C3); % 添加标注 
    title('潮位数据');
    MakeGif('demo_dynamic_trend.Gif',i);hold on;%保存gif动态图
    pause(0.01);% 暂停 0.01s
end

%% 画legend
%方法一
kk=legend('h1');
set(kk,'location','NorthEast','Box', 'off','fontsize',ssize,'FontName',fontnamed);%'orientation','horizontal',
%方法二
% columnlegend(2,{'L1','L2','L3','L4','L5','L6'},'North');%表示一行放三个图例以及图例的位置

%% Matlab中有许多位置可以选择:
% 'North' inside plot box near top
% 'South' inside bottom
% 'East' inside right
% 'West' inside left
% 'NorthEast' inside top right (default for 2-D plots)
% 'NorthWest' inside top left
% 'SouthEast' inside bottom right
% 'SouthWest' inside bottom left
% 'NorthOutside' outside plot box near top
% 'SouthOutside' outside bottom
% 'EastOutside' outside right
% 'WestOutside' outside left
% 'NorthEastOutside' outside top right (default for 3-D plots)
% 'NorthWestOutside' outside top left
% 'SouthEastOutside' outside bottom right
% 'SouthWestOutside' outside bottom left
% 'Best' least conflict with data in plot 与绘图中的数据冲突最小
% 'BestOutside' least unused space outside plot

%% 设置完毕后,按照所需分辨率、格式输出
figW = figureWidth;
figH = figureHeight;
set(figureHandle,'PaperUnits',figureUnits);
set(figureHandle,'PaperPosition',[0 0 figW figH]);
fileout = 'demo_dynamic_trend';
print(figureHandle,[fileout,'.png'],'-r600','-dpng');

12 【MATLAB】科研绘图第十二期带误差棒的柱状图

%% 带误差棒的柱状图

%% Made by Lwcah(公众号:Lwcah)
%% 公众号:Lwcah
%% 知乎、B站、小红书、抖音同名账号:Lwcah,感谢关注~
%% 更多MATLAB+SCI绘图教程敬请观看~

%% 清除变量
close all;clear all;clc;

%% 1行1列
%% 一幅图的时候figureWidth = 8.5;figureHeight = 8;调整这两个参数就可以
%定义整幅图出现的在电脑屏幕上的位置以及长和宽
%这里有必要解释一下为什么figureWidth要设置为8.5;
%因详细解释需要很长的篇幅,请转公众号观看该天的文章。
figureHandle = figure;
figureUnits = 'centimeters';
figureWidth = 8.5;
figureHeight = 6;
set(gcf, 'Units', figureUnits, 'Position', [28 20 figureWidth figureHeight]);
% 注:28代表出图时图的左下角相对于整个电脑屏幕的左下角向左偏移28个单位,向上偏移20个单位。
% 可自行调节两个数字让图出在自己屏幕的某个位置

%% 定义字体和字号大小
%% 通常的SCI一般Arial字体和10字号通用
fontnamed='华文中宋';%字号名字Arial
ssize=10;%字号大小
%% 如果是中文论文可以相应的更改字号名字如下
% '华文中宋' '华文仿宋' '华文宋体' '华文新魏' '华文楷体'
% '华文琥珀' '华文细黑' '华文行楷' '华文隶书' '宋体'
% '方正姚体' '微软雅黑' '方正舒体' '新宋体'
% '幼圆' '楷体' '等线' '隶书' '黑体'

%% 给定绘图颜色
C1 = chinesecolors(343);%香水玫瑰
C2 = chinesecolors(150);%靛青
C3 = chinesecolors(523);%玫瑰灰
% C4 = chinesecolors(17);%鹅冠红

%% 数据
m = 5;
n = 3;
x = 1:m;
y = rand(m, n) + 2;

%% 绘制误差棒图barweb
neg = rand(m, n);% 误差限
barweb(y, neg, 1, {'label1', 'label2', 'label3', 'label4', 'label5'});

%% 背景颜色
set(gcf,'Color',[1 1 1]);
%% 修图的标准格式代码
% text(0.5,0.9,'(a) XXX','fontsize',ssize,'FontName',fontnamed);%,'horiz','center'
xlabel('X-axis','fontsize',ssize,'FontName',fontnamed);
ylabel('Y-axis','fontsize',ssize,'FontName',fontnamed);
% axis([0 10 0 7]);%XY轴的范围
% xticks([1 2 3 4 5 6 7 8 9 10]);%画格网的时候的小刻度
% xticklabels({'1','2','3','4','5','6','7','8','9','10'});%加x轴刻度标注
% yticks([1 2 3 4 5 6]);%画格网的时候的小刻度
% yticklabels({'1','2','3','4','5','6'});%加y轴刻度标注
set(gca,'linewidth',1,'fontsize',ssize,'FontName',fontnamed);
% set(gca,'yticklabel',[]);%y轴不显示
% set(gca,'xticklabel',[]);%x轴不显示
grid on;box on;hold on;

%% 画legend
hLegend1=legend('A1', 'A2', 'A3','Location', 'northeast','Box', 'off','Orientation','horizontal','fontsize',ssize,'FontName',fontnamed);
%方法一
% kk=legend('h1');
% set(kk,'location','NorthEast','Box', 'off','fontsize',ssize,'FontName',fontnamed);%'orientation','horizontal',
%方法二
% columnlegend(2,{'L1','L2','L3','L4','L5','L6'},'North');%表示一行放三个图例以及图例的位置

%% Matlab中有许多位置可以选择:
% 'North' inside plot box near top
% 'South' inside bottom
% 'East' inside right
% 'West' inside left
% 'NorthEast' inside top right (default for 2-D plots)
% 'NorthWest' inside top left
% 'SouthEast' inside bottom right
% 'SouthWest' inside bottom left
% 'NorthOutside' outside plot box near top
% 'SouthOutside' outside bottom
% 'EastOutside' outside right
% 'WestOutside' outside left
% 'NorthEastOutside' outside top right (default for 3-D plots)
% 'NorthWestOutside' outside top left
% 'SouthEastOutside' outside bottom right
% 'SouthWestOutside' outside bottom left
% 'Best' least conflict with data in plot 与绘图中的数据冲突最小
% 'BestOutside' least unused space outside plot

%% 设置完毕后,按照所需分辨率、格式输出
figW = figureWidth;
figH = figureHeight;
set(figureHandle,'PaperUnits',figureUnits);
set(figureHandle,'PaperPosition',[0 0 figW figH]);
fileout = 'demo_errorbar';
print(figureHandle,[fileout,'.png'],'-r600','-dpng');

13 【MATLAB】科研绘图第十三期表示散点分布的双柱状统计图

%% 表示散点分布的双柱状统计图

%% Made by Lwcah(公众号:Lwcah)
%% 公众号:Lwcah
%% 知乎、B站、小红书、抖音同名账号:Lwcah,感谢关注~
%% 更多MATLAB+SCI绘图教程敬请观看~

%% 清除变量
close all;clear all;clc;

%% 1行1列
%% 一幅图的时候figureWidth = 8.5;figureHeight = 8;调整这两个参数就可以
%定义整幅图出现的在电脑屏幕上的位置以及长和宽
%这里有必要解释一下为什么figureWidth要设置为8.5;
%因详细解释需要很长的篇幅,请转公众号观看该天的文章。
figureHandle = figure;
figureUnits = 'centimeters';
figureWidth = 8.5;
figureHeight = 6;
set(gcf, 'Units', figureUnits, 'Position', [28 20 figureWidth figureHeight]);
% 注:28代表出图时图的左下角相对于整个电脑屏幕的左下角向左偏移28个单位,向上偏移20个单位。
% 可自行调节两个数字让图出在自己屏幕的某个位置

%% 定义字体和字号大小
%% 通常的SCI一般Arial字体和10字号通用
fontnamed='华文中宋';%字号名字Arial
ssize=10;%字号大小
%% 如果是中文论文可以相应的更改字号名字如下
% '华文中宋' '华文仿宋' '华文宋体' '华文新魏' '华文楷体'
% '华文琥珀' '华文细黑' '华文行楷' '华文隶书' '宋体'
% '方正姚体' '微软雅黑' '方正舒体' '新宋体'
% '幼圆' '楷体' '等线' '隶书' '黑体'

%% 给定绘图颜色
C1 = chinesecolors(343);%香水玫瑰
C2 = chinesecolors(150);%靛青
C3 = chinesecolors(523);%玫瑰灰
% C4 = chinesecolors(17);%鹅冠红

%% 数据
x = 1:30;
y = x+rand(1,30)*0.01;

%% 表示散点分布的双柱状统计图绘图
[n1,ctr1] = hist(x,20);
[n2,ctr2] = hist(y,20);

subplot(2,2,2);
plot(x,y,'.');
axis on; h1 = gca;hold on;box on;grid on;
xlabel('X-axis','fontsize',ssize,'FontName',fontnamed);
ylabel('Y-axis','fontsize',ssize,'FontName',fontnamed);

subplot(2,2,4);
bar(ctr1,-n1,1);axis off; h2 = gca;

subplot(2,2,1);
barh(ctr2,-n2,1);axis off; h3 = gca;

h1.Position = [0.35 0.35 0.55 0.55];
h2.Position = [.35 .03 .55 .15];
h3.Position = [.08 .35 .15 .55];


%% 修图的标准格式代码
% text(0.5,0.9,'(a) XXX','fontsize',ssize,'FontName',fontnamed);%,'horiz','center'
% title('1000');
% xlabel('X-axis','fontsize',ssize,'FontName',fontnamed);
% ylabel('Y-axis','fontsize',ssize,'FontName',fontnamed);
% axis([0 10 0 7]);%XY轴的范围
% xticks([1 2 3 4 5 6 7 8 9 10]);%画格网的时候的小刻度
% xticklabels({'1','2','3','4','5','6','7','8','9','10'});%加x轴刻度标注
% yticks([1 2 3 4 5 6]);%画格网的时候的小刻度
% yticklabels({'1','2','3','4','5','6'});%加y轴刻度标注
set(gca,'linewidth',1,'fontsize',ssize,'FontName',fontnamed);
% set(gca,'yticklabel',[]);%y轴不显示
% set(gca,'xticklabel',[]);%x轴不显示
grid on;box on;hold on;

%% 画legend
% hLegend1=legend('A1', 'A2', 'A3','Location', 'northeast','Box', 'off','Orientation','horizontal','fontsize',ssize,'FontName',fontnamed);
%方法一
% kk=legend('h1');
% set(kk,'location','NorthEast','Box', 'off','fontsize',ssize,'FontName',fontnamed);%'orientation','horizontal',
%方法二
% columnlegend(2,{'L1','L2','L3','L4','L5','L6'},'North');%表示一行放三个图例以及图例的位置

%% Matlab中有许多位置可以选择:
% 'North' inside plot box near top
% 'South' inside bottom
% 'East' inside right
% 'West' inside left
% 'NorthEast' inside top right (default for 2-D plots)
% 'NorthWest' inside top left
% 'SouthEast' inside bottom right
% 'SouthWest' inside bottom left
% 'NorthOutside' outside plot box near top
% 'SouthOutside' outside bottom
% 'EastOutside' outside right
% 'WestOutside' outside left
% 'NorthEastOutside' outside top right (default for 3-D plots)
% 'NorthWestOutside' outside top left
% 'SouthEastOutside' outside bottom right
% 'SouthWestOutside' outside bottom left
% 'Best' least conflict with data in plot 与绘图中的数据冲突最小
% 'BestOutside' least unused space outside plot


%% 背景颜色
set(gcf,'Color',[1 1 1]);
%% 设置完毕后,按照所需分辨率、格式输出
figW = figureWidth;
figH = figureHeight;
set(figureHandle,'PaperUnits',figureUnits);
set(figureHandle,'PaperPosition',[0 0 figW figH]);
fileout = 'demo_scartter_double_bar';
print(figureHandle,[fileout,'.png'],'-r600','-dpng');


本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/1244386.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

AI:87-基于深度学习的街景图像地理位置识别

🚀 本文选自专栏:人工智能领域200例教程专栏 从基础到实践,深入学习。无论你是初学者还是经验丰富的老手,对于本专栏案例和项目实践都有参考学习意义。 ✨✨✨ 每一个案例都附带有在本地跑过的代码,详细讲解供大家学习,希望可以帮到大家。欢迎订阅支持,正在不断更新中,…

VR云游:让旅游产业插上数字化翅膀,打造地方名片

自多地入冬降温以来&#xff0c;泡温泉成了许多人周末度假的选择&#xff0c;在气温持续走低的趋势下&#xff0c;温泉游也迎来了旺季&#xff1b;但是依旧有些地区温度依旧温暖&#xff0c;例如南京的梧桐美景也吸引了不少游客前去打卡&#xff0c;大家穿着汉服与金黄的树叶合…

【Hello Go】Go语言并发编程

并发编程 概述基本概念go语言的并发优势 goroutinegoroutine是什么创建goroutine如果主goroutine退出runtime包GoschedGoexitGOMAXPROCS channel无缓冲的channel有缓冲的channelrange和close单向channel 定时器TimerTicker Select超时 概述 基本概念 并行和并发概念 并行 &…

佳易王个体诊所病历登记系统查询软件教程

佳易王个体诊所病历登记系统查询软件教程 在开处方时可以随时查看该病人的历史病历。 软件功能&#xff1a; 1、配方模板&#xff1a;可以自由添加配方分类&#xff0c;预先设置药品配方&#xff0c;可以一键导入电子处方。 2、正常开药&#xff1a;可以灵活选择药品&#x…

什么是持续集成的自动化测试?

持续集成的自动化测试 如今互联网软件的开发、测试和发布&#xff0c;已经形成了一套非常标准的流程&#xff0c;最重要的组成部分就是持续集成&#xff08;Continuous integration&#xff0c;简称CI&#xff0c;目前主要的持续集成系统是Jenkins&#xff09;。 那么什么是持…

【图文详解】SiamFC++与图注意力的强强联合:单目标追踪系统

1.研究背景与意义 随着计算机视觉技术的不断发展&#xff0c;单目标追踪&#xff08;Single Object Tracking, SOT&#xff09;作为计算机视觉领域的一个重要研究方向&#xff0c;已经在许多实际应用中得到了广泛的应用。单目标追踪系统可以通过分析视频序列中的目标运动&…

【Typroa使用】Typroa+PicGo-Core(command line)+gitee免费图片上传配置

TyproaPicGo-Core(command line)gitee免费图片上传配置 本文是在win10系统下配置typroapicGo-Core(command line)gitee图片上传的教程。需要的环境和工具有&#xff1a; gitee账号&#xff0c;新建仓库及token令牌&#xff1b;已经安装了的typroa&#xff0c;需要0.9.98版本以上…

Python 字典(dict)基础学习

一、字典的基础定义(key:value)键值对 my_dict {"王力宏": 99, "周杰伦": 88, "林俊杰": 77} my_dict2 {} my_dict3 dict() print(my_dict) print(my_dict2) print(my_dict3) 字典基础定义 字典名 {key1:value1,key2:value2,key3:value3}…

shell 脚本的函数和数组

函数 —— 封装的一个公式&#xff1a;sin、cos、tan —— 函数为脚本的别名 —— 函数就是一个功能模块&#xff0c;在函数中写执行的命令即可&#xff1b;使用函数可以避免代码重复&#xff0c;增加可读性&#xff0c;简化脚本&#xff0c;使用函数可以将大的工程分割为若…

【C++初阶】STL详解(六)Stack与Queue的介绍与使用

本专栏内容为&#xff1a;C学习专栏&#xff0c;分为初阶和进阶两部分。 通过本专栏的深入学习&#xff0c;你可以了解并掌握C。 &#x1f493;博主csdn个人主页&#xff1a;小小unicorn ⏩专栏分类&#xff1a;C &#x1f69a;代码仓库&#xff1a;小小unicorn的代码仓库&…

UE5 中的computer shader使用

转载&#xff1a;UE5 中的computer shader使用 - 知乎 (zhihu.com) 目标 通过蓝图输入参数&#xff0c;经过Compture Shader做矩阵运算 流程 1. 新建插件 2. 插件设置 3. 声明和GPU内存对齐的参数结构 4. 声明Compture Shader结构 5. 参数绑定 6. 着色器实现 7. 分配 work gr…

【Spring】 IoCDI

回顾 企业命名规范 大驼峰:BookDao(首字母都大写) 类名 小驼峰:bookDao(第一个字母小写) 方法名 蛇形:book_dao(小写下划线_) 数据库 串形:book-dao(小写连字符-) 项目文件夹 各种注解 学习Spring MVC, 其实就是学习各种Web开发需要⽤的到注解 a. RequestMapping: 路由…

计算机中文编程工具构件之透明按钮,编程工具下载,零基础自学编程

计算机中文编程工具构件之透明按钮&#xff0c;编程工具下载&#xff0c;零基础自学编程 给大家分享一款中文编程工具&#xff0c;零基础轻松学编程&#xff0c;不需英语基础&#xff0c;编程工具可下载。 这款工具不但可以连接部分硬件&#xff0c;而且可以开发大型的软件&am…

HashML——让更多企业读懂数据,用好AI

随着大模型技术的兴起&#xff0c;数据智能和AI正成为企业数字化转型的新驱动力。 酷克数据研发推出的新一代高级分析和数据科学工具箱HashML自推出以来&#xff0c;受到了众多企业和技术爱好者的广泛关注。在最近的直播中&#xff0c;我们邀请了HashData的数据科学工程师&…

目标检测算法 - YOLOv3

文章目录 1. Backbone Darknet-532. 整体架构3. 损失函数4. 训练过程5. 预测过程 YOLOv1、YOLOv2都是在CVPR这种正规的计算机视觉学术会议上发表的正式学术论文。 YOLOv3不算一篇严谨的学术论文&#xff0c;是作者随笔写的技术报告。 YOLOv3性能&#xff1a; 1. Backbone Dark…

七要素微气象仪气象数据监测助手

WX-WQX7 随着科技的发展&#xff0c;气象预测的准确性已成为人们日常生活的重要参考。而七要素微气象仪&#xff0c;作为新型的气象探测设备&#xff0c;以其精细化的数据测量和解析能力&#xff0c;正在改变我们的天气预测方式。 一、产品介绍 七要素微气象仪是一款集成了温…

STM32:基本定时器原理和定时程序

一、初识定时器TIM 定时器就是计数器&#xff0c;定时器的作用就是设置一个时间&#xff0c;然后时间到后就会通过中断等方式通知STM32执行某些程序。定时器除了可以实现普通的定时功能&#xff0c;还可以实现捕获脉冲宽度&#xff0c;计算PWM占空比&#xff0c;输出PWM波形&am…

TEMU平台商品欧盟站要求电子和电气产品提供CE-EMC(Electric)资质

CE-EMC认证是欧盟对于市场上销售的电子和电气产品所要求的一个重要认证标准。该认证指令规定了产品在电磁环境下的辐射和抗干扰性能要求&#xff0c;以确保产品在使用时不会对其他设备和系统产生干扰&#xff0c;并且能够正常工作&#xff0c;不受其他设备的干扰。 CE EMC认证…

【机器学习 | 白噪声检验】检验模型学习成果 检验平稳性最佳实践,确定不来看看?

&#x1f935;‍♂️ 个人主页: AI_magician &#x1f4e1;主页地址&#xff1a; 作者简介&#xff1a;CSDN内容合伙人&#xff0c;全栈领域优质创作者。 &#x1f468;‍&#x1f4bb;景愿&#xff1a;旨在于能和更多的热爱计算机的伙伴一起成长&#xff01;&#xff01;&…

flink和机器学习模型的常用组合方式

背景 flink是一个低延迟高吞吐的系统&#xff0c;每秒处理的数据量高达数百万&#xff0c;而机器模型一般比较笨重&#xff0c;虽然功能强大&#xff0c;但是qps一般都比较低&#xff0c;日常工作中&#xff0c;我们一般是如何把flink和机器学习模型组合起来一起使用呢? fli…