D3 二维图表的绘制系列(二十七)日历热力图

d3js绘制热力图 【代码】d3js绘制svg热力图 阅读详情

上一篇: 盒须图

下一篇: 弦图

代码结构和初始化画布的Chart对象介绍,请先看 这里

本图完整的源码地址: 这里

1 图表效果

在这里插入图片描述

2 数据

{
   
   
  "2018-01-01": 2,
  "2018-01-02": 1,
  "2018-01-03": 2,
  "2018-01-04": 2,
  "2018-01-05": 4,
  "2018-01-06": 3,
  "2018-01-07": 6,
  "2018-01-08": 4,
  "2018-01-09": 1,
  "2018-01-10": 4,
  "2018-01-11": 3,
  "2018-01-12": 5,
  "2018-01-13": 0,
  "2018-01-14": 0,
  "2018-01-15": 0,
  "2018-01-16": 2,
  "2018-01-17": 1,
  "2018-01-18": 3,
  "2018-01-19": 6,
  "2018-01-20": 5,
  "2018-01-21": 1,
  "2018-01-22": 2,
  "2018-01-23": 1,
  "2018-01-24": 3,
  "2018-01-25": 2,
  "2018-01-26": 5,
  "2018-01-27": 4,
  "2018-01-28": 6,
  "2018-01-29": 2,
  "2018-01-30": 1,
  "2018-01-31": 3,
  "2018-02-01": 1,
  "2018-02-02": 0,
  "2018-02-03": 3,
  "2018-02-04": 6,
  "2018-02-05": 1,
  "2018-02-06": 1,
  "2018-02-07": 3,
  "2018-02-08": 3,
  "2018-02-09": 2,
  "2018-02-10": 5,
  "2018-02-11": 1,
  "2018-02-12": 0,
  "2018-02-13": 3,
  "2018-02-14": 2,
  "2018-02-15": 3,
  "2018-02-16": 4,
  "2018-02-17": 5,
  "2018-02-18": 6,
  "2018-02-19": 0,
  "2018-02-20": 1,
  "2018-02-21": 2,
  "2018-02-22": 1,
  "2018-02-23": 3,
  "2018-02-24": 5,
  "2018-02-25": 4,
  "2018-02-26": 2,
  "2018-02-27": 1,
  "2018-02-28": 2,
  "2018-03-01": 3,
  "2018-03-02": 2,
  "2018-03-03": 5,
  "2018-03-04": 6,
  "2018-03-05": 0,
  "2018-03-06": 1,
  "2018-03-07": 6,
  "2018-03-08": 1,
  "2018-03-09": 4,
  "2018-03-10": 5,
  "2018-03-11": 4,
  "2018-03-12": 2,
  "2018-03-13": 0,
  "2018-03-14": 2,
  "2018-03-15": 3,
  "2018-03-16": 2,
  "2018-03-17": 4,
  "2018-03-18": 3,
  "2018-03-19": 1,
  "2018-03-20": 3,
  "2018-03-21": 2,
  "2018-03-22": 4,
  "2018-03-23": 1,
  "2018-03-24": 4,
  "2018-03-25": 3,
  "2018-03-26": 6,
  "2018-03-27": 2,
  "2018-03-28": 2,
  "2018-03-29": 1,
  "2018-03-30": 3,
  "2018-03-31": 2,
  "2018-04-01": 3,
  "2018-04-02": 2,
  "2018-04-03"
使用python绘制日历热力图 阅读详情

相关推荐

D3 二维图表的绘制系列(一)介绍

1 介绍 D3 (或者叫 D3.js )是一个基于 web 标准的 JavaScript 可视化库. D3 可以借助 SVG, Canvas 以及HTML 将你的数据生动的展现出来. D3 结合了强大的可视化交互技术以及数据驱动 DOM 的技术,让你可以借助于现代浏览器的强大功能自由的对数据进行可视化 学习了d3一个多月,通过绘制一些简单的二维图表,总算入门了d3。强烈推荐《D3数据可视化实战...

zjw_python的博客 6万+

D3 二维图表的绘制系列(三十一)热力地图(heatMap.js)

上一篇: 平行坐标系折线图 代码结构和初始化画布的Chart对象介绍,请先看 这里 本图完整的源码地址: 这里 1 图表效果 2 数据 本文源码中提供了中国地图的GeoJson数据, 点击这里下载,如果想获取其他地区的数据,可参考这篇文章 3 关键代码 导入GeoJson格式的地图数据 d3.json('./china.json').then(function(data){ .... 一些简单...

zjw_python的博客 6770

MATLAB|热力日历图

MATLAB|热力日历图

猪猪侠 641

STM32+4G模块+MQTT协议:从零构建稳定可靠的物联网通讯链路

本文详细介绍了如何利用STM32、4G模块和MQTT协议构建稳定可靠的物联网通讯链路。通过硬件选型、AT指令配置和MQTT连接实战,帮助开发者实现低功耗、高可靠性的数据传输,特别适合户外和移动场景应用。

weixin_29191081的博客 339

5分钟搞定!用FunASR在本地快速部署达摩院Paraformer语音识别模型

本文提供了一份快速部署指南,教你如何在5分钟内利用FunASR工具包在本地电脑上启动达摩院Paraformer语音识别模型。Paraformer作为一款非自回归端到端模型,以其推理速度快、识别精度高的特点,结合FunASR的一键式模型加载和统一API,让开发者能轻松构建本地语音识别系统,极大降低了前沿AI技术的应用门槛。

q9w8e7r6t5的博客 611

基于MicroPython的ESP32与微信小程序MQTT通信实战

本文详细介绍了基于MicroPython的ESP32与微信小程序通过MQTT协议实现远程控制的完整实战方案。项目利用巴法云作为免费MQTT服务器,提供了从设备端编程、小程序开发到通信调试的全流程指南,帮助开发者快速构建低成本、易上手的物联网应用,如智能开关、传感器监控等。

week9的博客 640

ESP32-S3开发板烧录失败?Bootloader模式进入全攻略

本文详细解析了ESP32-S3开发板烧录失败的常见原因及解决方案,重点介绍了如何正确进入Bootloader模式。通过按键组合、硬件设计差异分析、自动下载模式失效排查等实用技巧,帮助开发者高效解决烧录问题,提升开发效率。

weixin_28716769的博客 603

STM32C8T6实战:用PID算法搞定超级电容的10W无线恒功率充电(附代码避坑)

本文详细介绍了如何使用STM32C8T6和PID算法实现超级电容的10W无线恒功率充电。通过优化硬件设计、动态调整PID参数以及三重滤波技术,解决了超级电容充电过程中的功率尖峰和效率问题。附有代码示例和调试经验,帮助开发者快速实现高效稳定的无线充电方案。

weixin_29190169的博客 413

33、嵌入式系统中的内存操作与实时操作系统

本博客详细探讨了嵌入式系统中的内存操作和实时操作系统(RTOS)的基本原理及应用。内容涵盖C、C++和MicroPython三种语言下的SDRAM读写示例,并结合机器人真空吸尘器的实际应用说明内存的使用场景。此外,还介绍了RTOS的核心概念、组件及其工作机制,包括任务、事件、互斥锁、信号量、队列等,并以FreeRTOS和Mbed OS为例展示了RTOS的配置与使用方法。最后,通过常见问题和实践项目加深对嵌入式系统开发的理解。

zz67890的博客 150

实验7:机器学习油田产量预测-代码数据-完整代码数据可直接运行-计算机毕设

实验7:机器学习油田产量预测-代码数据-完整代码数据可直接运行-计算机毕设

机器学习深度学习业余选手 479

K8s(二十一):在 Kubernetes 集群中部署 MySQL8.0 高可用集群(1主2从)

🔴 K8s(二十一):在 Kubernetes 集群中部署 MySQL8.0 高可用集群(1主2从)

✨ 欢迎来到【Seal ^_^ 的CSDN博客】!✨ 3万+

SAP B1中文培訓教材_SDK

公司内部培训资料,对开发工具 ,DIAPI, UIAPI,Add-ON有详细解说

汉书HE8,好用的汇编代码编写工具

汉书HE8,好用的汇编代码编写工具早期编写汇编代码所用功能强大

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain&#39;s apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath(&#39;DeepLearnToolbox&#39;));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand(&#39;state&#39;,0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W&#39;); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand(&#39;state&#39;,0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = &#39;sigm&#39;;%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, &#39;Too big error&#39;);```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand(&#39;state&#39;,0)sae = saesetup([784 100]);sae.ae{1}.activation_function = &#39;sigm&#39;;sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)&#39;)% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = &#39;sigm&#39;;nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, &#39;Too big error&#39;);```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x&#39;,28,28,60000))/255;test_x = double(reshape(test_x&#39;,28,28,10000))/255;train_y = double(train_y&#39;);test_y = double(test_y&#39;);%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you&#39;ll get around 1.2% errorrand(&#39;state&#39;,0)cnn.layers = { struct(&#39;type&#39;, &#39;i&#39;) %input layer struct(&#39;type&#39;, &#39;c&#39;, &#39;outputmaps&#39;, 6, &#39;kernelsize&#39;, 5) %convolution layer struct(&#39;type&#39;, &#39;s&#39;, &#39;scale&#39;, 2) %sub sampling layer struct(&#39;type&#39;, &#39;c&#39;, &#39;outputmaps&#39;, 12, &#39;kernelsize&#39;, 5) %convolution layer struct(&#39;type&#39;, &#39;s&#39;, &#39;scale&#39;, 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, &#39;Too big error&#39;);```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand(&#39;state&#39;,0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, &#39;Too big error&#39;);%% ex2 neural net with L2 weight decayrand(&#39;state&#39;,0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, &#39;Too big error&#39;);%% ex3 neural net with dropoutrand(&#39;state&#39;,0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, &#39;Too big error&#39;);%% ex4 neural net with sigmoid activation functionrand(&#39;state&#39;,0)nn = nnsetup([784 100 10]);nn.activation_function = &#39;sigm&#39;; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, &#39;Too big error&#39;);%% ex5 plotting functionalityrand(&#39;state&#39;,0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = &#39;softmax&#39;; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, &#39;Too big error&#39;);%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand(&#39;state&#39;,0)nn = nnsetup([784 20 10]); nn.output = &#39;softmax&#39;; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, &#39;Too big error&#39;);```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

上一篇: D3 二维图表的绘制系列(二十六)盒须图
下一篇: D3 二维图表的绘制系列(二十八)关系图-弦图 chord
PAT-python-zjw
博客等级 码龄10年 381粉丝 408原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值
⌂ 换网址