フィルターのクリア

plot table with subplot

4 ビュー (過去 30 日間)
Giulio Vialetto
Giulio Vialetto 2018 年 11 月 5 日
回答済み: Walter Roberson 2018 年 11 月 5 日
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'};

回答 (1 件)

Walter Roberson
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.

カテゴリ

Help Center および File ExchangeMigrate GUIDE Apps についてさらに検索

タグ

製品


リリース

R2018b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by