Histogram visualization for Spatio-temporal data stored in a cell array.
1 次查看(过去 30 天)
显示 更早的评论
I have a cell array (attached) of size 1X40; each cell is a double of size 110 X 120. this is a Spatio-temporal data. I would like to visualize histograms for each time interval by stacking these individual histograms.
0 个评论
回答(1 个)
Image Analyst
2017-2-5
Try this:
% Cleanup/initialization
clc; % Clear the command window.
close all; % Close all figures (except those of imtool.)
% clear; % Erase all existing variables. Or clearvars if you want.
workspace; % Make sure the workspace panel is showing.
format long g;
format compact;
fontSize = 20;
s = load('m1.mat')
m1 = s.m1
for k = 1 : length(m1)
thisData = m1{k};
[counts, binValues] = histcounts(thisData);
plot(binValues(1:end-1), counts, '-', 'LineWidth', 2);
hold on;
end
grid on;
caption = sprintf('Histogram of %d Arrays', length(m1));
title(caption, 'FontSize', fontSize, 'Interpreter', 'None');
xlabel('Data Value', 'FontSize', fontSize);
ylabel('Count', 'FontSize', fontSize);
% Set up figure properties:
% Enlarge figure to full screen.
set(gcf, 'Units', 'Normalized', 'OuterPosition', [0 0 1 1]);
% Get rid of tool bar and pulldown menus that are along top of figure.
set(gcf, 'Toolbar', 'none', 'Menu', 'none');
% Give a name to the title bar.
set(gcf, 'Name', 'Demo by ImageAnalyst', 'NumberTitle', 'Off')
2 个评论
Image Analyst
2017-2-9
So get your slice (single row or column) of your 2-D hist data (like you'd get from hist3), and then call bar()
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Histograms 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!