How to brush data of subplots containing histogram and scatterplot?
Show older comments
Dear all,
From experimental data I need to find cross relations. This I will do by making a scatterplot and a histogram. I cooked some code (hereunder) but I'm not happy with result. I need the histogram generated by BARH (HGGROUP) rather than HIST (PATCH) because I want the bins on the yaxis. Also I want to have a log scale for the histogram's occurences so I need set the Baseline property to 1 instead of 0. For the sake of convenience I want link the Yaxes of both plots. Last but not least all properties have to be set programmatically not manualy.
x = -4:0.3:4;
y = randn(1000,2);
figure
hS1=subplot(2,1,1);
hist(y(:,2),x);
title('you can only manually assign y(:,2) to ydatasource (hist-->patch?)')
hl=linkdata('on');
brush on
hS2=subplot(2,1,2);
plot(y(:,1),y(:,2),'.');
linkdata on
brush on
linkaxes([hS1 hS2],'x')

Who can help me with rewriting the code using a BARH so I have a rotated histogram with a logaritmic occurence scale?
Thanks in advanced Patrick
Answers (1)
Raptrick
on 13 Mar 2014
2 Comments
Star Strider
on 13 Mar 2014
I am not sure what you are doing. One problem might be that variable a has zero occurrences in the bins defined by variable b in this example. It will not show up on the bar plot.
Raptrick
on 14 Mar 2014
Categories
Find more on Scatter Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
