Okay I figured it out finally.
As written in my edit above, you can use findall
to find the handles of all axes-objects.
After using it, try to find out which handle refers to which axes by looking at the entries like X/YLim
in get(A(i))
, after finding the axes-ID and storing it (the k
-th element in A) to idx = A(K)
, use this script to read the entries from the histogram plotted by imhist()
-> The values are replicated as often as described by the bins (YData
) and then replotted by hist
into a new figure:
% ----------------------------------------------------------------------- %
b = get(idx);
b = get(b.Children); % Get the Plot-Handle
x = b.XData; % Bins
y = b.YData; % Bin-Counts
data = [];
for i = 1:length(x)
data = [data x(i)*ones(1,y(i))]; % replicate data
end
figure
hist(data, length(unique(x)));
xlim([min(data) max(data)]);
Edit: The for-loop is a quick and dirty one ;-) Im sure there's a nicer solution e.g. by using repmat
, but I was only interested in a quick solution :-)