How to brush data of subplots containing histogram and scatterplot?
이전 댓글 표시
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
답변 (1개)
Raptrick
2014년 3월 13일
댓글 수: 2
Star Strider
2014년 3월 13일
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
2014년 3월 14일
카테고리
도움말 센터 및 File Exchange에서 Scatter Plots에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

