plot table with subplot
8 ビュー (過去 30 日間)
古いコメントを表示
Dear all,
I would like to plot a table of data into a figure with four subplots. I wrote this code but it doesn't work, any suggestion?
%
% Plot Heat consumption
%
data_display = DATA{DATA{:,{'FLAG'}} == 0,{'H_kW'}};
figure
title('Heat consumption - kW')
subplot(2,2,[1 3]);
histogram(data_display,n_obs);
set(gca, 'xScale', 'log');
title('Histogram heat cons. (kW)');
xlabel('Heat cons.');
ylabel('Num. of observations');
subplot(2,2,2);
title('QQplot heat cons.');
qqplot(data_display);
%
% Calculate pivot table of data
%
T_Heat = round(log10(DATA{index,{'H_kW'}}));
%
% Create index and count values
%
count_T_Heat = accumarray(T_Heat(T_Heat>0),1);
[row,~] = size(count_T_Heat);
index_T_Heat = zeros(row,1);
for i=1:row
index_T_Heat(i,1) = i;
end
%
% Create pivot table
T_Heat = uitable('Data',[index_T_Heat,count_T_Heat]);
T_Heat.ColumnName ={'Heat_cons_log_scale','Observation_count'};
0 件のコメント
回答 (1 件)
Walter Roberson
2018 年 11 月 5 日
uitable ignores axes and so ignores subplot.
What you can do is subplot() anyhow, but then fetch the OuterPosition property. Use that as the Position of the uitable. You could delete the subplot axes afterwards.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Subplots についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!