MATLAB | 绘图复刻(十一) | 截断的含散点及误差棒的分组柱状图

hey大家好久不见,本期带来一篇绘图复刻,居然已经出到第11篇了,不知道有朝一日有没有机会破百,本期绘制的是《PNAS》期刊中pnas.2200057120文章的figure03,文章题目为Intranasal delivery of full-length anti-Nogo-A antibody: A potential alternative route for therapeutic antibodies to central nervous system targets可在以下网址下载该文章pdf原文:

  • https://www.pnas.org/doi/epdf/10.1073/pnas.2200057120

本期要复刻的绘图长这样:

本人复刻的效果长这样:

虽然还是有些许不同但是大部分元素已经还原出来了,以下为教程部分:

请尽量使用新版本的MATLAB,比较旧版本的MATLAB无XJitter功能,本人目前较忙近期不会有空开发类似功能,因此在我未有空开发相关功能前,请尽量使用比较新的版本!!!!!!!!~


教程部分

0 数据准备

这里随便随机生成了一点数据,文章中的五个颜色都被我提取了出来,我们这次先取用前两个颜色:

figure('Units','normalized','Position',[.2,.3,.36,.45],'Color','w');rng(24)
% 随机生成了两组数据
DataA = rand(7,1)*ones(1,5).*2+rand(7,5)./3.5;
DataB = rand(7,1)*ones(1,5)./2+rand(7,5)./3.5;
meanData = [mean(DataA,2), mean(DataB,2)];% 文章图片中的颜色数据
CList = [188,188,240; 160,161,166; 237,187,128;177,202,233; 245,185,192]./255;
CList = CList([1,2],:);
% CList = CList([4,5],:);% 横坐标标签文本
NameList = {'Cortex';'Hippocampus';'Cerebellum';'Brainstem';'Cervical spinal cord';'Thoracic spinal cord';'Lumbar spinal cord'};

1 基础绘图

柱状图

hold on
% 绘制柱状图 ---------------------------------------------------------------
barHdl = bar(meanData,'EdgeColor','none','FaceAlpha',.5,'BarWidth',.7);
% 修改配色
barHdl(1).FaceColor = CList(1,:);
barHdl(2).FaceColor = CList(2,:);

散点图

% 绘制散点图 ---------------------------------------------------------------
XA = barHdl(1).XEndPoints.'*ones(1,size(DataA,2));
scatter(XA(:),DataA(:),55,'filled','o','MarkerEdgeColor','k','LineWidth',.8,...'CData',CList(1,:),'XJitter','rand','XJitterWidth',0.15)
XB = barHdl(2).XEndPoints.'*ones(1,size(DataB,2));
scatter(XB(:),DataB(:),55,'filled','o','MarkerEdgeColor','k','LineWidth',.8,...'CData',CList(2,:),'XJitter','rand','XJitterWidth',0.15)

误差棒

这里直接用的标准差:

% 绘制误差棒 ---------------------------------------------------------------
errorbar(barHdl(1).XEndPoints,meanData(:,1),std(DataA,0,2),'vertical',...'LineStyle','none','LineWidth',1,'Color','k')
errorbar(barHdl(2).XEndPoints,meanData(:,2),std(DataB,0,2),'vertical',...'LineStyle','none','LineWidth',1,'Color','k')


3 坐标区域简单修饰

主要是调整字体,并修改X轴刻度标签:

% 绘制误差棒 ---------------------------------------------------------------
errorbar(barHdl(1).XEndPoints,meanData(:,1),std(DataA,0,2),'vertical',...'LineStyle','none','LineWidth',1,'Color','k')
errorbar(barHdl(2).XEndPoints,meanData(:,2),std(DataB,0,2),'vertical',...'LineStyle','none','LineWidth',1,'Color','k')


4 截断坐标轴

这里用的我之前写的一个函数,为了怕大家找起来麻烦,放在了文末及文末的gitee仓库里。

以下是调用文末截断坐标轴函数实现的:

% 截断坐标轴
truncAxis('y',[1,1.4]);


5 坐标轴精修

包括隐藏baseline,添加Y轴标签,修改坐标轴粗细及刻度方向等:

fig = gcf;
ax1 = fig.Children(1);
ax2 = fig.Children(2);% 隐藏基线
ax1.XColor = 'none';
ax1.Children(end).BaseLine.Color = 'none';% 坐标轴修饰
ax1.LineWidth = 1.5; 
ax2.LineWidth = 1.5;
ax1.TickDir = 'out';
ax2.TickDir = 'out';% 增添Y轴标签
ax1.YLabel.String = 'ug of Ab/ g wet weight of tissue';
ax1.YLabel.Position = [0 1.4 -1];
ax1.YLabel.FontSize = 15;


6 添加显著性标注

就一个柱子一个柱子加吧,改改序号和字符就能得到比较符合想法的效果:

% 随便加点显著性标志N = 2; % 第二个柱
S = '***';
% 要修改右侧柱请改成barHdl(2)及DataB(N,:)
X = barHdl(1).XEndPoints(N);
Y = max(DataA(N,:))+.1;
errorbar(X,Y,.2,'horizontal','LineStyle','none','LineWidth',1,'Color','k')
text(X,Y,S,'FontSize',15,'FontWeight','bold','FontName','Arial',...'HorizontalAlignment','center','VerticalAlignment','baseline')N = 3; % 第三个柱
S = '****';
% 要修改右侧柱请改成barHdl(2)及DataB(N,:)
X = barHdl(1).XEndPoints(N);
Y = max(DataA(N,:))+.1;
errorbar(X,Y,.2,'horizontal','LineStyle','none','LineWidth',1,'Color','k')
text(X,Y,S,'FontSize',15,'FontWeight','bold','FontName','Arial',...'HorizontalAlignment','center','VerticalAlignment','baseline')N = 6; % 第六个柱
S = '****';
% 要修改右侧柱请改成barHdl(2)及DataB(N,:)
X = barHdl(1).XEndPoints(N);
Y = max(DataA(N,:))+.1;
errorbar(X,Y,.2,'horizontal','LineStyle','none','LineWidth',1,'Color','k')
text(X,Y,S,'FontSize',15,'FontWeight','bold','FontName','Arial',...'HorizontalAlignment','center','VerticalAlignment','baseline')


更多颜色展示


完整代码

教程完整代码

% code for pnas.2200057120fig03
% by slandarer
% bar chart with trunc-axisfigure('Units','normalized','Position',[.2,.3,.36,.45],'Color','w');rng(24)
% 随机生成了两组数据
DataA = rand(7,1)*ones(1,5).*2+rand(7,5)./3.5;
DataB = rand(7,1)*ones(1,5)./2+rand(7,5)./3.5;
meanData = [mean(DataA,2), mean(DataB,2)];% 文章图片中的颜色数据
CList = [188,188,240; 160,161,166; 237,187,128;177,202,233; 245,185,192]./255;
CList = CList([1,2],:);
% CList = CList([4,5],:);% 横坐标标签文本
NameList = {'Cortex';'Hippocampus';'Cerebellum';'Brainstem';'Cervical spinal cord';'Thoracic spinal cord';'Lumbar spinal cord'};hold on
% 绘制柱状图 ---------------------------------------------------------------
barHdl = bar(meanData,'EdgeColor','none','FaceAlpha',.5,'BarWidth',.7);
% 修改配色
barHdl(1).FaceColor = CList(1,:);
barHdl(2).FaceColor = CList(2,:);
% 绘制散点图 ---------------------------------------------------------------
XA = barHdl(1).XEndPoints.'*ones(1,size(DataA,2));
scatter(XA(:),DataA(:),55,'filled','o','MarkerEdgeColor','k','LineWidth',.8,...'CData',CList(1,:),'XJitter','rand','XJitterWidth',0.15)
XB = barHdl(2).XEndPoints.'*ones(1,size(DataB,2));
scatter(XB(:),DataB(:),55,'filled','o','MarkerEdgeColor','k','LineWidth',.8,...'CData',CList(2,:),'XJitter','rand','XJitterWidth',0.15)
% 绘制误差棒 ---------------------------------------------------------------
errorbar(barHdl(1).XEndPoints,meanData(:,1),std(DataA,0,2),'vertical',...'LineStyle','none','LineWidth',1,'Color','k')
errorbar(barHdl(2).XEndPoints,meanData(:,2),std(DataB,0,2),'vertical',...'LineStyle','none','LineWidth',1,'Color','k')% 坐标区域简单修饰
ax = gca;
ax.XTick = 1:length(barHdl(1).XEndPoints);
ax.XTickLabel = NameList(:);
ax.FontName = 'Arial';
ax.FontWeight = 'bold';
ax.FontSize = 11;
ax.XTickLabelRotation = 35;% 截断坐标轴
truncAxis('y',[1,1.4]);
fig = gcf;
ax1 = fig.Children(1);
ax2 = fig.Children(2);% 隐藏基线
ax1.XColor = 'none';
ax1.Children(end).BaseLine.Color = 'none';% 坐标轴修饰
ax1.LineWidth = 1.5; 
ax2.LineWidth = 1.5;
ax1.TickDir = 'out';
ax2.TickDir = 'out';% 增添Y轴标签
ax1.YLabel.String = 'ug of Ab/ g wet weight of tissue';
ax1.YLabel.Position = [0 1.4 -1];
ax1.YLabel.FontSize = 15;% -------------------------------------------------------------------------
% 随便加点显著性标志N = 2; % 第二个柱
S = '***';
% 要修改右侧柱请改成barHdl(2)及DataB(N,:)
X = barHdl(1).XEndPoints(N);
Y = max(DataA(N,:))+.1;
errorbar(X,Y,.2,'horizontal','LineStyle','none','LineWidth',1,'Color','k')
text(X,Y,S,'FontSize',15,'FontWeight','bold','FontName','Arial',...'HorizontalAlignment','center','VerticalAlignment','baseline')N = 3; % 第三个柱
S = '****';
% 要修改右侧柱请改成barHdl(2)及DataB(N,:)
X = barHdl(1).XEndPoints(N);
Y = max(DataA(N,:))+.1;
errorbar(X,Y,.2,'horizontal','LineStyle','none','LineWidth',1,'Color','k')
text(X,Y,S,'FontSize',15,'FontWeight','bold','FontName','Arial',...'HorizontalAlignment','center','VerticalAlignment','baseline')N = 6; % 第六个柱
S = '****';
% 要修改右侧柱请改成barHdl(2)及DataB(N,:)
X = barHdl(1).XEndPoints(N);
Y = max(DataA(N,:))+.1;
errorbar(X,Y,.2,'horizontal','LineStyle','none','LineWidth',1,'Color','k')
text(X,Y,S,'FontSize',15,'FontWeight','bold','FontName','Arial',...'HorizontalAlignment','center','VerticalAlignment','baseline')

截断坐标轴工具函数完整代码

function truncAxis(varargin)
% @author : slandarer
% gzh  : slandarer随笔% 获取参数
if isa(varargin{1},'matlab.graphics.axis.Axes')ax=varargin{1};varargin(1)=[];
elseax=gca;
end
hold(ax,'on');
% box(ax,'off')
ax.XAxisLocation='bottom';
ax.YAxisLocation='left';
axisPos=ax.Position;
axisXLim=ax.XLim;
axisYLim=ax.YLim;
axisXScale=diff(axisXLim);
axisYScale=diff(axisYLim);
truncRatio=1/20;
Xtrunc=[];Ytrunc=[];
for i=1:length(varargin)-1switch truecase strcmpi('X',varargin{i}),Xtrunc=varargin{i+1};case strcmpi('Y',varargin{i}),Ytrunc=varargin{i+1};end
end
switch truecase isempty(Xtrunc)% 复制坐标区域ax2=copyAxes(ax);% 修改轴基础属性ax2.XTickLabels=[];ax2.XColor='none';% 修改坐标区域范围ax.YLim=[axisYLim(1),Ytrunc(1)];ax2.YLim=[Ytrunc(2),axisYLim(2)];% 坐标区域重定位ax.Position(4)=axisPos(4)*(1-truncRatio)/(axisYScale-diff(Ytrunc))*(Ytrunc(1)-axisYLim(1));ax2.Position(2)=axisPos(2)+ax.Position(4)+axisPos(4)*truncRatio;ax2.Position(4)=axisPos(4)*(1-truncRatio)/(axisYScale-diff(Ytrunc))*(axisYLim(2)-Ytrunc(2));% 链接轴范围变动linkaxes([ax,ax2],'x')% 添加线和标识符if strcmp(ax.Box,'on')ax.Box='off';ax2.Box='off';annotation('line',[1,1].*(ax.Position(1)+ax.Position(3)),[ax.Position(2),ax.Position(2)+ax.Position(4)],'LineStyle','-','LineWidth',ax.LineWidth,'Color',ax.XColor);annotation('line',[1,1].*(ax.Position(1)+ax.Position(3)),[ax2.Position(2),ax2.Position(2)+ax2.Position(4)],'LineStyle','-','LineWidth',ax.LineWidth,'Color',ax.XColor);annotation('line',[ax.Position(1),ax.Position(1)+ax.Position(3)],[1,1].*(ax2.Position(2)+ax2.Position(4)),'LineStyle','-','LineWidth',ax.LineWidth,'Color',ax.XColor);elseannotation('line',[ax.Position(1),ax.Position(1)+ax.Position(3)],[1,1].*(ax.Position(2)+ax.Position(4)),'LineStyle',':','LineWidth',ax.LineWidth,'Color',ax.XColor);annotation('line',[ax.Position(1),ax.Position(1)+ax.Position(3)],[1,1].*(ax2.Position(2)),'LineStyle',':','LineWidth',ax.LineWidth,'Color',ax.XColor);endcreateSlash([ax.Position(1)-.2,ax.Position(2)+ax.Position(4)-.2,.4,.4])createSlash([ax.Position(1)-.2,ax2.Position(2)-.2,.4,.4])createSlash([ax.Position(1)+ax.Position(3)-.2,ax.Position(2)+ax.Position(4)-.2,.4,.4])createSlash([ax.Position(1)+ax.Position(3)-.2,ax2.Position(2)-.2,.4,.4])case isempty(Ytrunc) % 复制坐标区域ax2=copyAxes(ax);% 修改轴基础属性ax2.YTickLabels=[];ax2.YColor='none';% 修改坐标区域范围ax.XLim=[axisXLim(1),Xtrunc(1)];ax2.XLim=[Xtrunc(2),axisXLim(2)];% 坐标区域重定位ax.Position(3)=axisPos(3)*(1-truncRatio)/(axisXScale-diff(Xtrunc))*(Xtrunc(1)-axisXLim(1));ax2.Position(1)=axisPos(1)+ax.Position(3)+axisPos(3)*truncRatio;ax2.Position(3)=axisPos(3)*(1-truncRatio)/(axisXScale-diff(Xtrunc))*(axisXLim(2)-Xtrunc(2));% 链接轴范围变动linkaxes([ax,ax2],'y')% 添加线和标识符if strcmp(ax.Box,'on')ax.Box='off';ax2.Box='off';annotation('line',[ax.Position(1),ax.Position(1)+ax.Position(3)],[1,1].*(ax.Position(2)+ax.Position(4)),'LineStyle','-','LineWidth',ax.LineWidth,'Color',ax.XColor);annotation('line',[ax2.Position(1),ax2.Position(1)+ax2.Position(3)],[1,1].*(ax.Position(2)+ax.Position(4)),'LineStyle','-','LineWidth',ax.LineWidth,'Color',ax.XColor);annotation('line',[1,1].*(ax2.Position(1)+ax2.Position(3)),[ax2.Position(2),ax2.Position(2)+ax2.Position(4)],'LineStyle','-','LineWidth',ax.LineWidth,'Color',ax.XColor);elseannotation('line',[1,1].*(ax.Position(1)+ax.Position(3)),[ax2.Position(2),ax2.Position(2)+ax2.Position(4)],'LineStyle',':','LineWidth',ax.LineWidth,'Color',ax.XColor);annotation('line',[1,1].*(ax2.Position(1)),[ax2.Position(2),ax2.Position(2)+ax2.Position(4)],'LineStyle',':','LineWidth',ax.LineWidth,'Color',ax.XColor);endcreateSlash([ax.Position(1)+ax.Position(3)-.2,ax.Position(2)-.2,.4,.4])createSlash([ax2.Position(1)-.2,ax.Position(2)-.2,.4,.4])createSlash([ax.Position(1)+ax.Position(3)-.2,ax.Position(2)+ax.Position(4)-.2,.4,.4])createSlash([ax2.Position(1)-.2,ax.Position(2)+ax.Position(4)-.2,.4,.4])case (~isempty(Ytrunc))&(~isempty(Ytrunc))% 复制坐标区域ax2=copyAxes(ax);ax3=copyAxes(ax);ax4=copyAxes(ax);% 修改轴基础属性ax2.XTickLabels=[];ax2.XColor='none';ax3.XTickLabels=[];ax3.XColor='none';ax3.YTickLabels=[];ax3.YColor='none';ax4.YTickLabels=[];ax4.YColor='none';% 修改坐标区域范围ax.YLim=[axisYLim(1),Ytrunc(1)];ax.XLim=[axisXLim(1),Xtrunc(1)];ax2.XLim=[axisXLim(1),Xtrunc(1)];ax2.YLim=[Ytrunc(2),axisYLim(2)];ax3.XLim=[Xtrunc(2),axisXLim(2)];ax3.YLim=[Ytrunc(2),axisYLim(2)];ax4.XLim=[Xtrunc(2),axisXLim(2)];ax4.YLim=[axisYLim(1),Ytrunc(1)];% 坐标区域重定位ax.Position(3)=axisPos(3)*(1-truncRatio)/(axisXScale-diff(Xtrunc))*(Xtrunc(1)-axisXLim(1));ax.Position(4)=axisPos(4)*(1-truncRatio)/(axisYScale-diff(Ytrunc))*(Ytrunc(1)-axisYLim(1));ax2.Position(2)=axisPos(2)+ax.Position(4)+axisPos(4)*truncRatio;ax2.Position(3)=axisPos(3)*(1-truncRatio)/(axisXScale-diff(Xtrunc))*(Xtrunc(1)-axisXLim(1));ax2.Position(4)=axisPos(4)*(1-truncRatio)/(axisYScale-diff(Ytrunc))*(axisYLim(2)-Ytrunc(2));ax3.Position(1)=axisPos(1)+ax.Position(3)+axisPos(3)*truncRatio;ax3.Position(2)=axisPos(2)+ax.Position(4)+axisPos(4)*truncRatio;ax3.Position(3)=axisPos(3)*(1-truncRatio)/(axisXScale-diff(Xtrunc))*(axisXLim(2)-Xtrunc(2));ax3.Position(4)=axisPos(4)*(1-truncRatio)/(axisYScale-diff(Ytrunc))*(axisYLim(2)-Ytrunc(2));ax4.Position(1)=axisPos(1)+ax.Position(3)+axisPos(3)*truncRatio;ax4.Position(3)=axisPos(3)*(1-truncRatio)/(axisXScale-diff(Xtrunc))*(axisXLim(2)-Xtrunc(2));ax4.Position(4)=axisPos(4)*(1-truncRatio)/(axisYScale-diff(Ytrunc))*(Ytrunc(1)-axisYLim(1));% 链接轴范围变动linkaxes([ax3,ax2],'y')linkaxes([ax4,ax3],'x')linkaxes([ax,ax2],'x')linkaxes([ax,ax4],'y')% 添加线和标识符if strcmp(ax.Box,'on')ax.Box='off';ax2.Box='off';ax3.Box='off';ax4.Box='off';annotation('line',[ax.Position(1),ax.Position(1)+ax.Position(3)],[1,1].*(ax2.Position(2)+ax2.Position(4)),'LineStyle','-','LineWidth',ax.LineWidth,'Color',ax.XColor);annotation('line',[ax3.Position(1),ax3.Position(1)+ax3.Position(3)],[1,1].*(ax2.Position(2)+ax2.Position(4)),'LineStyle','-','LineWidth',ax.LineWidth,'Color',ax.XColor);annotation('line',[1,1].*(ax4.Position(1)+ax4.Position(3)),[ax3.Position(2),ax3.Position(2)+ax3.Position(4)],'LineStyle','-','LineWidth',ax.LineWidth,'Color',ax.XColor);annotation('line',[1,1].*(ax4.Position(1)+ax4.Position(3)),[ax4.Position(2),ax4.Position(2)+ax4.Position(4)],'LineStyle','-','LineWidth',ax.LineWidth,'Color',ax.XColor);elseannotation('line',[1,1].*(ax.Position(1)+ax.Position(3)),[ax2.Position(2),ax2.Position(2)+ax2.Position(4)],'LineStyle',':','LineWidth',ax.LineWidth,'Color',ax.XColor);annotation('line',[1,1].*(ax3.Position(1)),[ax2.Position(2),ax2.Position(2)+ax2.Position(4)],'LineStyle',':','LineWidth',ax.LineWidth,'Color',ax.XColor);annotation('line',[1,1].*(ax.Position(1)+ax.Position(3)),[ax.Position(2),ax.Position(2)+ax.Position(4)],'LineStyle',':','LineWidth',ax.LineWidth,'Color',ax.XColor);annotation('line',[1,1].*(ax3.Position(1)),[ax.Position(2),ax.Position(2)+ax.Position(4)],'LineStyle',':','LineWidth',ax.LineWidth,'Color',ax.XColor);annotation('line',[ax.Position(1),ax.Position(1)+ax.Position(3)],[1,1].*(ax.Position(2)+ax.Position(4)),'LineStyle',':','LineWidth',ax.LineWidth,'Color',ax.XColor);annotation('line',[ax.Position(1),ax.Position(1)+ax.Position(3)],[1,1].*(ax2.Position(2)),'LineStyle',':','LineWidth',ax.LineWidth,'Color',ax.XColor);annotation('line',[ax4.Position(1),ax4.Position(1)+ax4.Position(3)],[1,1].*(ax.Position(2)+ax.Position(4)),'LineStyle',':','LineWidth',ax.LineWidth,'Color',ax.XColor);annotation('line',[ax4.Position(1),ax4.Position(1)+ax4.Position(3)],[1,1].*(ax2.Position(2)),'LineStyle',':','LineWidth',ax.LineWidth,'Color',ax.XColor);endcreateSlash([ax.Position(1)-.2,ax.Position(2)+ax.Position(4)-.2,.4,.4])createSlash([ax.Position(1)-.2,ax2.Position(2)-.2,.4,.4])createSlash([ax4.Position(1)+ax4.Position(3)-.2,ax.Position(2)+ax.Position(4)-.2,.4,.4])createSlash([ax4.Position(1)+ax4.Position(3)-.2,ax2.Position(2)-.2,.4,.4])createSlash([ax.Position(1)+ax.Position(3)-.2,ax.Position(2)-.2,.4,.4])createSlash([ax.Position(1)+ax.Position(3)-.2,ax2.Position(2)+ax2.Position(4)-.2,.4,.4])createSlash([ax4.Position(1)-.2,ax.Position(2)-.2,.4,.4])createSlash([ax4.Position(1)-.2,ax2.Position(2)+ax2.Position(4)-.2,.4,.4])% 修改当前坐标区域,方便legend添加set(gcf,'currentAxes',ax3)
end
% 复制原坐标区域全部可复制属性function newAX=copyAxes(ax)axStruct=get(ax);fNames=fieldnames(axStruct);newAX=axes('Parent',ax.Parent);coeList={'CurrentPoint','XAxis','YAxis','ZAxis','BeingDeleted',...'TightInset','NextSeriesIndex','Children','Type','Legend'};for n=1:length(coeList)coePos=strcmp(fNames,coeList{n});fNames(coePos)=[];endfor n=1:length(fNames)newAX.(fNames{n})=ax.(fNames{n});endcopyobj(ax.Children,newAX)end
% 添加截断标识符函数function createSlash(pos)anno=annotation('textbox');anno.String='/';anno.LineStyle='none';anno.FontSize=15;anno.Position=pos;anno.FitBoxToText='on';anno.VerticalAlignment='middle';anno.HorizontalAlignment='center';end
end

以上已经是本文全部内容,若懒得复制代码,可以去以下gitee仓库获取全部代码:

https://gitee.com/slandarer/PLTreprint/

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

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

相关文章

Debian/Ubuntu清理硬盘空间

Debian/Ubuntu清理硬盘空间_debian清理磁盘空间_weixin_43606319的博客-CSDN博客 1. 删除残余的配置文件 通常Debian/Ubuntu删除软件包可以用两条命令 sudo apt-get remove <package-name> sudo apt-get purge <package-name> remove将会删除软件包&#xff0…

车载以太网物理层

车载以太网物理层 O S I 参考模型的第 1 层&#xff08; 最底层&#xff09;。负责逻辑信号&#xff08; 比特流&#xff09;与物理信号&#xff08;电信号、光信号&#xff09;之间的互相转换&#xff0c;通过传输介质为数据链路层提供物理连接。 车载以太网与传统以太网相比…

java实现docx,pdf文件动态填充数据

一&#xff0c;引入pom 根据需求引入自己所需pom org.apache.poi poi 4.1.1 org.apache.poi poi-ooxml 4.1.1 org.jxls jxls 2.6.0 ch.qos.logback logback-core org.jxls jxls-poi 1.2.0 fr.opensagres.xdocreport fr.opensagres.xdocreport.core 2.0.2 fr.opensagres.xdocrep…

QT笔记——QProcess学习

我们常常想通过某一个类&#xff0c;来启动一个外部进程 本文将讲解如何通过QProcess来进行启动外部进程 一&#xff1a;了解QProcess QProcess是Qt框架提供的一个类&#xff0c;用于在应用程序中执行外部进程。它提供了一系列函数来启动、控制和与外部进程进行交互 1.启动进程…

C++入门基础(万字详解!!!)

文章目录 前言1.C关键字2.命名空间3.C的输入输出4.缺省参数4.1 全缺省4.2 半缺省 5.函数重载6. 引用6.1 引用的特性6.2 引用的使用场景6.3 引用和指针 7.内联函数7.1 特性 8.auto关键字8.1 注意事项 9. 基于范围的for循环9.1 使用条件 10.指针控制nullptr10.1 注意事项 11.总结…

fastadmin 自定义搜索分类和时间范围

1.分类搜索&#xff0c;分类信息获取----php 2.对应html页面&#xff0c;页面底部加搜索提交代码&#xff08;这里需要注意&#xff1a;红框内容&#xff09; 图上代码----方便直接复制使用 <script id"countrySearch" type"text/html"><!--form…

安全 1自测

常见对称加密算法&#xff1a; DES&#xff08;Data Encryption Standard&#xff09;&#xff1a;数据加密标准&#xff0c;速度较快&#xff0c;适用于加密大量数据的场合&#xff1b; 3DES&#xff08;Triple DES&#xff09;&#xff1a;是基于DES&#xff0c;对一块数据用…

Spring相关面试题

&#x1f44f;作者简介&#xff1a;大家好&#xff0c;我是爱写博客的嗯哼&#xff0c;爱好Java的小菜鸟 &#x1f525;如果感觉博主的文章还不错的话&#xff0c;请&#x1f44d;三连支持&#x1f44d;一下博主哦 &#x1f4dd;个人博客&#xff1a;敬请期待 &#x1f4d5;系列…

时序预测 | MATLAB实现EEMD-GRU、GRU集合经验模态分解结合门控循环单元时间序列预测对比

时序预测 | MATLAB实现EEMD-GRU、GRU集合经验模态分解结合门控循环单元时间序列预测对比 目录 时序预测 | MATLAB实现EEMD-GRU、GRU集合经验模态分解结合门控循环单元时间序列预测对比效果一览基本介绍模型搭建程序设计参考资料 效果一览 基本介绍 1.MATLAB实现EEMD-GRU、GRU时…

【Linux】—— 进程程序替换

目录 序言 &#xff08;一&#xff09;替换原理 1、进程角度——见见猪跑 1️⃣ 认识 execl 函数 2、程序角度——看图理解 &#xff08;二&#xff09;替换函数 1、命名理解 2、函数理解 1️⃣execlp 2️⃣execv 3️⃣execvp 4️⃣execle 5️⃣execve 6️⃣execve…

机器学习重要内容:特征工程之特征抽取

目录 1、简介 2、⭐为什么需要特征工程 3、特征抽取 3.1、简介 3.2、特征提取主要内容 3.3、字典特征提取 3.4、"one-hot"编码 3.5、文本特征提取 3.5.1、英文文本 3.5.2、结巴分词 3.5.3、中文文本 3.5.4、Tf-idf ⭐所属专栏&#xff1a;人工智能 文中提…

LLaMA长度外推高性价比trick:线性插值法及相关改进源码阅读及相关记录

前言 最近&#xff0c;开源了可商用的llama2&#xff0c;支持长度相比llama1的1024&#xff0c;拓展到了4096长度&#xff0c;然而&#xff0c;相比GPT-4、Claude-2等支持的长度&#xff0c;llama的长度外推显得尤为重要&#xff0c;本文记录了三种网络开源的RoPE改进方式及相…

Vue-打印组件页面

场景: 需要将页面的局部信息打印出来&#xff0c;只在前端实现&#xff0c;不要占用后端的资源。经过百度经验&#xff0c;决定使用 print-js和html2canvas组件。 1. 下载包 npm install print-js --save npm install --save html2canvas 2. 组件内引用 <script>impo…

TPAMI, 2023 | 用压缩隐逆向神经网络进行高精度稀疏雷达成像

CoIR: Compressive Implicit Radar | IEEE TPAMI, 2023 | 用压缩隐逆向神经网络进行高精度稀疏雷达成像 注1:本文系“无线感知论文速递”系列之一,致力于简洁清晰完整地介绍、解读无线感知领域最新的顶会/顶刊论文(包括但不限于Nature/Science及其子刊;MobiCom, Sigcom, MobiSy…

Java【算法 04】HTTP的认证方式之DIGEST认证详细流程说明及举例

HTTP的认证方式之DIGEST 1.是什么2.认值流程2.1 客户端发送请求2.2 服务器返回质询信息2.2.1 质询参数2.2.2 质询举例 2.3 客户端生成响应2.4 服务器验证响应2.5 服务器返回响应 3.算法3.1 SHA-2563.1.1 Response3.1.2 A13.1.3 A2 3.2 MD53.2.1 Request-Digest3.2.2 A13.2.3 A2…

CSS3 中新增了哪些常见的特性?

聚沙成塔每天进步一点点 ⭐ 专栏简介⭐ 圆角&#xff08;Border Radius&#xff09;⭐ 渐变&#xff08;Gradients&#xff09;⭐ 阴影&#xff08;Box Shadow&#xff09;⭐ 文本阴影&#xff08;Text Shadow&#xff09;⭐ 透明度&#xff08;Opacity&#xff09;⭐ 过渡&…

Nacos和GateWay路由转发NotFoundException: 503 SERVICE_UNAVAILABLE “Unable to find

问题再现&#xff1a; 2023-08-15 16:51:16,151 DEBUG [reactor-http-nio-2][CompositeLog.java:147] - [dc73b32c-1] Encoding [{timestampTue Aug 15 16:51:16 CST 2023, path/content/course/list, status503, errorService Unavai (truncated)...] 2023-08-15 16:51:16,17…

leetcode27—移除元素

思路&#xff1a; 参考26题目双指针的思想&#xff0c;只不过这道题不是快慢指针。 看到示例里面数组是无序的&#xff0c;也就是说后面的元素也是可能跟给定 val值相等的&#xff0c;那么怎么处理呢。就想到了从前往后遍历&#xff0c;如果left对应的元素 val时&#xff0c…

汽车制造业上下游协作时 外发数据如何防泄露?

数据文件是制造业企业的核心竞争力&#xff0c;一旦发生数据外泄&#xff0c;就会给企业造成经济损失&#xff0c;严重的&#xff0c;可能会带来知识产权剽窃损害、名誉伤害等。汽车制造业&#xff0c;会涉及到重要的汽车设计图纸&#xff0c;像小米发送汽车设计图纸外泄事件并…

[足式机器人]Part5 机械设计 Ch00/01 绪论+机器结构组成与连接 ——【课程笔记】

本文仅供学习使用 本文参考&#xff1a; 《机械设计》 王德伦 马雅丽课件与日常作业可登录网址 http://edu.bell-lab.com/manage/#/login&#xff0c;选择观摩登录&#xff0c;查看2023机械设计2。 机械设计-Ch00Ch01——绪论机器结构组成与连接 Ch00-绪论0.1 何为机械设计——…