Merge several histogras into a one single plot

I'm having multiple histograms of several images. I need to merege them in to a one histogram plot. I have tried so many ways and there it didn't work. It will be greatful if anyone can give me a possible way to do this.

回答 (1 件)

mizuki
mizuki 2016 年 9 月 22 日

1 投票

You can get histogram plot information by gca (get current axis) of gcf (get current figure). Under Axis properties, Histogram properties are stored.
% make two sample set
x1 = randn(100,1);
x2 = randn(100,1);
% draw the first histogram
figure(1)
histogram(x1);
h_f1 = gca; % get axis properties
d1 = h_f1.Children.Data; % get Data properties under Histogram property set
% draw the second histogram
figure(2)
histogram(x2);
h_f2 = gca;
d2 = h_f2.Children.Data;
figure(3)
histogram([d1 d2])
I am not sure if this is exactly what you wanted. For the next time, write what you have exactly tried so that others can figure out the problem instantly as well as you can get good answers.

カテゴリ

ヘルプ センター および File ExchangeData Distribution Plots についてさらに検索

質問済み:

2016 年 9 月 21 日

回答済み:

2016 年 9 月 22 日

Community Treasure Hunt

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

Start Hunting!

Translated by