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.hqwc.cn/news/67180.html

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

相关文章

在 Linux 虚拟机上使用 Azure 自定义脚本扩展版本

参考 azure创建虚拟机,创建虚拟机注意入站端口规则开放80端口、 2.转到资源,点击扩展应用程序,创建存储账户,创建容器,上传文件,选择文件,会自动执行部署。 apt-get update -y && apt-get insta…

分类预测 | MATLAB实现GWO-BiGRU-Attention多输入分类预测

分类预测 | MATLAB实现GWO-BiGRU-Attention多输入分类预测 目录 分类预测 | MATLAB实现GWO-BiGRU-Attention多输入分类预测预测效果基本介绍程序设计参考资料 预测效果 基本介绍 1.GWO-BiGRU-Attention 数据分类预测程序 2.代码说明:基于灰狼优化算法(GW…

Scratch 之 3D 介绍及教程

第一章 为什么 3D 很难? 1.1 3D 难在何处? 3D 之所以会使我们觉得困难,是因为 Scratch 软件只有两个坐标轴,既:X轴、Y轴。 2维坐标系 而 3D 却拥有三个坐标轴: 3维坐标系 怎么办?很简单&…

pdf怎么转换成jpg图片?这几个转换方法了解一下

pdf怎么转换成jpg图片?转换PDF文件为JPG图片格式在现代工作中是非常常见的需求,比如将PDF文件中的图表、表格或者图片转换为JPG格式后使用在PPT演示、网页设计等场景中。 【迅捷PDF转换器】是一款非常实用的工具,可以将PDF文件转换成多种不同…

14k字综述视觉大模型

目录 0.导读1.背景介绍1.1基础架构1.2目标函数1.2.1对比式学习1.2.2生成式学习1.3预训练1.3.1预训练数据集1.3.2微调1.3.3提示工程2.基于文本提示的基础模型2.1基于对比学习的方法2.1.1基于通用模型的对比方法2.1.2基于视觉定位基础模型的方法2.2基于生成式的方法2.3基于对比学…

发布游戏,进行打包。(Unity)

做到这里,我们的项目基本功能已经完成了,如果你还想使项目功能更加完善,可以自己思考如何补充,充分发挥并进行优化使效果达到更加美好。 首先呢,我们这里是说打包Window电脑游戏,我们直接点击菜单栏文件-&…

less基本使用

1 less中的变量 //对值进行声明 link-color: #ccc//定义变量名称 .{sleName} {}bg: background-color; //定义属性名称 .container {{bg}: red; }2 继承(复用重复样式) //继承必须位于选择器最后 //继承选择器名不能为变量 .a:hover:extend(.b) {}.a {…

C++ 二叉树(建立、销毁、前中后序遍历和层次遍历,寻找双亲结点等)

&#xff08;1&#xff09;结构体和类定义 struct BTreeNode {T data;BTreeNode* left, * right;BTreeNode() :data(0), left(nullptr), right(nullptr) {}BTreeNode(T val, BTreeNode<T>* leftChild nullptr, BTreeNode<T>* rightChild nullptr):data(val), le…

十九、docker学习-Dockerfile

Dockerfile 官网地址 https://docs.docker.com/engine/reference/builder/Dockerfile其实就是我们用来构建Docker镜像的源码&#xff0c;当然这不是所谓的编程源码&#xff0c;而是一些命令的集合&#xff0c;只要理解它的逻辑和语法格式&#xff0c;就可以很容易的编写Docke…

【佳佳怪文献分享】安全人机交互的学习责任分配与自动驾驶应用

标题&#xff1a;Learning Responsibility Allocations for Safe Human-Robot Interaction with Applications to Autonomous Driving 作者&#xff1a;Ryan K. Cosner, Yuxiao Chen, Karen Leung, and Marco Pavone 来源&#xff1a;2023 IEEE International Conference on …

JavaEE初阶:多线程 - 编程

1.认识线程 我们在之前认识了什么是多进程&#xff0c;今天我们来了解线程。 一个线程就是一个 "执行流". 每个线程之间都可以按照顺讯执行自己的代码. 多个线程之间 "同时" 执行 着多份代码. 引入进程这个概念&#xff0c;主要是为了解决并发编程这样的…

APP外包开发的iOS开发语言

学习iOS开发需要掌握Swift编程语言和相关的开发工具、框架和技术。而学习iOS开发需要时间和耐心&#xff0c;尤其是对于初学者。通过坚持不懈的努力&#xff0c;您可以逐步掌握iOS开发技能&#xff0c;构建出功能丰富、优质的移动应用。今天和大家分享学习iOS开发的一些建议方法…