Thanks for giving me an answer. Let me rephrase the question. I recooked the code and arrange the subplots as I want. Upper subplot contains rotated histogram with log occurences. Lower subplot contains scatter plot. Yaxes of subplots are linked. Why doesn't work the data brushing?
a = randn(1000,1);
b = 200*randn(1000,1)+1400;
bins = linspace(min(b),max(b),10);
[occur,binsout] = hist(b,bins);
figure
hS1 = subplot(2,1,1);
hB = barh(binsout,occur,'YDataSource','occur');
set(hB,'basevalue',1); %avoids errors when swiching to logscale
set(hS1,'xscale','log');
ylabel('b binned'); xlabel('log occurrence b');
hS2=subplot(2,1,2);
plot(a,b,'.')
ylabel('b'); xlabel('a');
linkdata on
linkprop([hS1 hS2],'ylim');
I'm not shure what to put as datasource for the histogram. Is it the variable OCCUR or is it required to recalculate it by HIST(B,BINS). How can get the same functionality as the initial question but in the layout (see picture) as I want.
Patrick