calendar heatmap

A GitHub-style calendar heatmap implemented in MATLAB.

Ahora está siguiendo esta publicación

Basic usage
% Generate a set of relatively continuous but fluctuating data.
T = datetime(2022, 1, 1) : datetime(2022, 12, 31);
t = linspace(1, length(T), 10);
V = interp1(t, rand(size(t)), 1:length(T)) + rand(1, length(T))./3;
% Draw calendar heatmap.
calHeatmap(2022, T, V)
% Adjust figure and axes size.
set(gcf, 'Position', [100, 500, 1500, 260])
set(gca, 'Position', [.03, .03, .9, .9])
% Adjust colormap.
colormap(pink)
Draw a calendar heatmap with missing dates
% Generate a set of relatively continuous but fluctuating data
% for only the first half of the year.
T = datetime(2022, 1, 1) : datetime(2022, 6, 30);
t = linspace(1, length(T), 10);
V = interp1(t, rand(size(t)), 1:length(T)) + rand(1, length(T))./3;
% Draw calendar heatmap.
calHeatmap(2022, T, V)
% Adjust figure and axes size.
set(gcf, 'Position', [100, 500, 1500, 260])
set(gca, 'Position', [.03, .03, .9, .9])
Draw a calendar heatmap between two months
% Generate a set of relatively continuous but fluctuating data.
T = datetime(2022, 1, 1) : datetime(2022, 12, 31);
t = linspace(1, length(T), 10);
V = interp1(t, rand(size(t)), 1:length(T)) + rand(1, length(T))./3;
% Generate calendar heatmaps from February to March.
% calHeatmap(year, time, value, [from, to])
calHeatmap(2022, T, V, [2, 3])
% Adjust figure and axes size.
set(gcf, 'Position', [100, 100, 800, 600])
set(gca, 'Position', [.15, .15, .7, .7])
Concatenation of calendar heatmaps for multiple years
load SimulatedStock.mat
T = TMW.Time;
V = TMW.High;
% Draw three heatmaps
ax1 = axes(gcf, 'Position', [0.06, 2/3 + 0.01, 1 - 0.07, 1/3 - 0.03]);
calHeatmap(ax1, 2013, T, V)
ax2 = axes(gcf, 'Position', [0.06, 1/3 + 0.01, 1 - 0.07, 1/3 - 0.03]);
calHeatmap(ax2, 2014, T, V)
ax3 = axes(gcf, 'Position', [0.06, 0 + 0.01, 1 - 0.07, 1/3 - 0.03]);
calHeatmap(ax3, 2015, T, V)
% Draw title and adjust position
TT = title(ax1, {'Simulated Stock heatmap'}, 'FontSize', 18, 'FontWeight', 'bold', 'FontName', 'Times New Roman');
TT.Position(2) = -0.1;
set(gcf, 'Position', [100, 100, 1200, 620])
% Adjust colormap
colormap(turbo)
% % Use colormap toolkit - slanCM
% % See : https://www.mathworks.com/matlabcentral/fileexchange/120088-200-colormaps
colormap(slanCM(21))
Built-in colormap of the function
slanCM(21)
slanCM(53)
turbo()

Citar como

Zhaoxu Liu / slandarer (2026). calendar heatmap (https://la.mathworks.com/matlabcentral/fileexchange/125835-calendar-heatmap), MATLAB Central File Exchange. Recuperado .

Información general

Compatibilidad con la versión de MATLAB

  • Compatible con cualquier versión

Compatibilidad con las plataformas

  • Windows
  • macOS
  • Linux
Versión Publicado Notas de la versión Action
1.3.1

Change cover.

1.3.0

English support.

1.2.0

avoid output

1.1.5

fix a picture

1.1.0

fix the bug of XTick

1.0.0