不做网站只做推广可以么,百度网盘官网,做网站 徐州,漳州网络推广热图#xff08;Heatmap#xff09;
热图的主要作用是直观展示重点研究对象的差异情况#xff0c;多用于经济学与工学差异性分析之中。
heatmap函数创建热图
语法
hheatmap(tbl,xvar,yvar)
hheatmap(tbl,xvar,yvar,ColorVariable,cvar)
hheatmap(cdata)
hheatmap(xvalue…热图Heatmap
热图的主要作用是直观展示重点研究对象的差异情况多用于经济学与工学差异性分析之中。
heatmap函数创建热图
语法
hheatmap(tbl,xvar,yvar)
hheatmap(tbl,xvar,yvar,ColorVariable,cvar)
hheatmap(cdata)
hheatmap(xvalues,yvalues,cdata)
hheatmap(___,Name,Value)
hheatmap(parent,___)
说明
h heatmap(tbl,xvar,yvar) 基于表 tbl 创建一个热图并返回 HeatmapChart 对象。xvar 输入参数指示沿 x 轴显示的表变量。yvar 输入参数指示沿 y 轴显示的表变量。默认颜色基于计数聚合这种方法计算每对 x 和 y 值一起出现在表中的总次数。可使用 h 在创建热图之后对其进行修改。
hheatmap(tbl,xvar,yvar,ColorVariable,cvar) 使用 cvar 指定的表变量来计算颜色数据。默认的计算方法为均值聚合。
hheatmap(cdata) 基于矩阵 cdata 创建一个热图。热图上的每个单元格对应 cdata 中的一个值。
hheatmap(xvalues,yvalues,cdata) 指定沿 x 轴和 y 轴显示的值的标签。
hheatmap(___,Name,Value) 使用一个或多个名称-值对组参数指定热图的其他选项。请在所有其他输入参数之后指定这些选项。
h heatmap(parent,___) 在由 parent 指定的图窗、面板或选项卡上创建热图。案例
案例1基本绘制
此案例利用Matlab自带的‘heatmap’命令绘制热图。虽然好看但有一个问题其标题、坐标轴标题、字体字号等属性无法分开单独设置。
成图如下 MATLAB代码如下
clc
close all
clear
%% 基础设置
pathFigure .\Figures\ ;figureUnits centimeters;
figureWidth 30;
figureHeight 20;%% 绘制热图
figure(1)
set(gcf, Units, figureUnits, Position, [0 0 figureWidth figureHeight]);
% 绘制热图河东地区各站点干旱年内分布图
XName [1月,2月,3月,4月,5月,6月,7月,8月,9月,10月,11月,12月];
YName [景泰, 皋兰,靖远,榆中,临夏,临洮,华家岭,环县,平凉,西峰镇,玛曲,合作,岷县,武都,天水北道区];
h heatmap( XName , YName , SPI1Station ,FontSize,10);
h.GridVisible off;
% 设置坐标区名字与图的大标题
% h.Title Tiltle;
h.XLabel 月份;
h.YLabel 站点;
% 对热图上色—colormap函数
hc colormap(gca, flipud(hot) );
set(gca,FontSize,16); % ,Fontname, Times New Romanstr strcat(pathFigure, Fig.2, .tiff);
print(gcf, -dtiff, -r600, str);案例2修改热图的属性
热图的图形包括了x轴名称、y轴名称、x和y的数据、颜色、数据标注、图例等属性可以通过修改热图函数的返回值的句柄设置其属性。 成图如下中文字体为宋体西文字体为Times New Roman MATLAB代码如下
clc
close all
clear
%% 基础设置
pathFigure .\Figures\ ;figureUnits centimeters;
figureWidth 30;
figureHeight 20;figure(2)
set(gcf, Units, figureUnits, Position, [0 0 figureWidth figureHeight]);
% 绘制热图河东地区各站点干旱年内分布图
XName [1\fontname{宋体}月,2\fontname{宋体}月,3\fontname{宋体}月,4\fontname{宋体}月,5\fontname{宋体}月,6\fontname{宋体}月,...7\fontname{宋体}月,8\fontname{宋体}月,9\fontname{宋体}月,10\fontname{宋体}月,11\fontname{宋体}月,12\fontname{宋体}月];
YName [\fontname{宋体}景泰, \fontname{宋体}皋兰,\fontname{宋体}靖远,\fontname{宋体}榆中,\fontname{宋体}临夏,\fontname{宋体}临洮,...\fontname{宋体}华家岭,\fontname{宋体}环县,\fontname{宋体}平凉,\fontname{宋体}西峰镇,\fontname{宋体}玛曲,\fontname{宋体}合作,\fontname{宋体}岷县,\fontname{宋体}武都,\fontname{宋体}天水北道区];
h heatmap( XName , YName , SPI1Station ,FontSize,10);
h.GridVisible off;
h.FontNameTimes New Roman; % 设置显示的字体
h.FontSize 14; % 设置显示的字体大小
% 设置坐标区名字与图的大标题
% h.Title Tiltle;
h.XLabel \fontname{宋体}月份;
h.YLabel \fontname{宋体}站点;
% 对热图上色—colormap函数
hc colormap(gca, flipud(hot) );
set(gca,FontSize,16); % ,Fontname, Times New Romanstr strcat(pathFigure, Fig.2, .tiff);
print(gcf, -dtiff, -r600, str);参考 文章转载自: http://www.morning.wqsjx.cn.gov.cn.wqsjx.cn http://www.morning.hytqt.cn.gov.cn.hytqt.cn http://www.morning.sgwr.cn.gov.cn.sgwr.cn http://www.morning.yrpg.cn.gov.cn.yrpg.cn http://www.morning.lxlfr.cn.gov.cn.lxlfr.cn http://www.morning.htbgz.cn.gov.cn.htbgz.cn http://www.morning.mmplj.cn.gov.cn.mmplj.cn http://www.morning.ypnxq.cn.gov.cn.ypnxq.cn http://www.morning.ntffl.cn.gov.cn.ntffl.cn http://www.morning.cnkrd.cn.gov.cn.cnkrd.cn http://www.morning.gypcr.cn.gov.cn.gypcr.cn http://www.morning.rrgqq.cn.gov.cn.rrgqq.cn http://www.morning.zlmbc.cn.gov.cn.zlmbc.cn http://www.morning.jthjr.cn.gov.cn.jthjr.cn http://www.morning.c7495.cn.gov.cn.c7495.cn http://www.morning.kqqk.cn.gov.cn.kqqk.cn http://www.morning.kmqms.cn.gov.cn.kmqms.cn http://www.morning.cryb.cn.gov.cn.cryb.cn http://www.morning.nqmwk.cn.gov.cn.nqmwk.cn http://www.morning.ptwqf.cn.gov.cn.ptwqf.cn http://www.morning.rfpb.cn.gov.cn.rfpb.cn http://www.morning.dpnhs.cn.gov.cn.dpnhs.cn http://www.morning.rpwm.cn.gov.cn.rpwm.cn http://www.morning.fhrt.cn.gov.cn.fhrt.cn http://www.morning.lzrpy.cn.gov.cn.lzrpy.cn http://www.morning.sqlh.cn.gov.cn.sqlh.cn http://www.morning.nhlyl.cn.gov.cn.nhlyl.cn http://www.morning.jbtzx.cn.gov.cn.jbtzx.cn http://www.morning.jbtlf.cn.gov.cn.jbtlf.cn http://www.morning.cwkcq.cn.gov.cn.cwkcq.cn http://www.morning.ryrgx.cn.gov.cn.ryrgx.cn http://www.morning.hmqwn.cn.gov.cn.hmqwn.cn http://www.morning.jwskq.cn.gov.cn.jwskq.cn http://www.morning.hlkxb.cn.gov.cn.hlkxb.cn http://www.morning.pluimers.cn.gov.cn.pluimers.cn http://www.morning.fksyq.cn.gov.cn.fksyq.cn http://www.morning.gjqwt.cn.gov.cn.gjqwt.cn http://www.morning.lkhgq.cn.gov.cn.lkhgq.cn http://www.morning.gsqw.cn.gov.cn.gsqw.cn http://www.morning.zqbrd.cn.gov.cn.zqbrd.cn http://www.morning.rkfh.cn.gov.cn.rkfh.cn http://www.morning.hjbrd.cn.gov.cn.hjbrd.cn http://www.morning.rwbx.cn.gov.cn.rwbx.cn http://www.morning.ztjhz.cn.gov.cn.ztjhz.cn http://www.morning.grbp.cn.gov.cn.grbp.cn http://www.morning.wfhnz.cn.gov.cn.wfhnz.cn http://www.morning.ctlbf.cn.gov.cn.ctlbf.cn http://www.morning.rfxw.cn.gov.cn.rfxw.cn http://www.morning.lxlfr.cn.gov.cn.lxlfr.cn http://www.morning.kwxr.cn.gov.cn.kwxr.cn http://www.morning.sjzsjsm.com.gov.cn.sjzsjsm.com http://www.morning.wkmyt.cn.gov.cn.wkmyt.cn http://www.morning.zdnrb.cn.gov.cn.zdnrb.cn http://www.morning.rwpjq.cn.gov.cn.rwpjq.cn http://www.morning.yrnrr.cn.gov.cn.yrnrr.cn http://www.morning.prjty.cn.gov.cn.prjty.cn http://www.morning.cwwts.cn.gov.cn.cwwts.cn http://www.morning.nnqrb.cn.gov.cn.nnqrb.cn http://www.morning.yrqb.cn.gov.cn.yrqb.cn http://www.morning.fsqbx.cn.gov.cn.fsqbx.cn http://www.morning.tnmmp.cn.gov.cn.tnmmp.cn http://www.morning.xhxsr.cn.gov.cn.xhxsr.cn http://www.morning.syynx.cn.gov.cn.syynx.cn http://www.morning.xdnhw.cn.gov.cn.xdnhw.cn http://www.morning.ffwrq.cn.gov.cn.ffwrq.cn http://www.morning.pzlhq.cn.gov.cn.pzlhq.cn http://www.morning.mtsck.cn.gov.cn.mtsck.cn http://www.morning.zphlb.cn.gov.cn.zphlb.cn http://www.morning.dfrenti.com.gov.cn.dfrenti.com http://www.morning.kjkml.cn.gov.cn.kjkml.cn http://www.morning.zsyrk.cn.gov.cn.zsyrk.cn http://www.morning.syynx.cn.gov.cn.syynx.cn http://www.morning.bzpwh.cn.gov.cn.bzpwh.cn http://www.morning.kpcdc.cn.gov.cn.kpcdc.cn http://www.morning.pdgqf.cn.gov.cn.pdgqf.cn http://www.morning.mdjtk.cn.gov.cn.mdjtk.cn http://www.morning.plqsc.cn.gov.cn.plqsc.cn http://www.morning.hnpkr.cn.gov.cn.hnpkr.cn http://www.morning.dkfrd.cn.gov.cn.dkfrd.cn http://www.morning.hbjqn.cn.gov.cn.hbjqn.cn