Wrong plotting by 2D (Joint) histogram

Hi all,

I have been benefited from the code posted here: http://www.igorexchange.com/node/1373 for 2D Joint histogram plot.
Recently I got a wrong graph attached. I have two columns data x and y, and x(i) is smaller than y(i). so the graph should show only in upper triangle area.
But the image shows all. Does anyone know the reason? Thanks

regards
Feifei


I'm not sure I understand. You must have two equal sized waves for a 2D histogram. Each x(i) has to have a corresponding y(i). My second thought is whether you have checked for rows where x=1005 if you do indeed have a row in y that has 630. Have you tried just plotting y vs x and displaying as points to see if the bottom triangle is empty.
sjr51 wrote:
I'm not sure I understand. You must have two equal sized waves for a 2D histogram. Each x(i) has to have a corresponding y(i). My second thought is whether you have checked for rows where x=1005 if you do indeed have a row in y that has 630. Have you tried just plotting y vs x and displaying as points to see if the bottom triangle is empty.


Thank you so much for your reply!
x and y have the same size. I didn't find the data point x=1005 and y=630, except in the figure. x(i) always less than y(i).
just plotting y vs x. the bottom triangle is empty!! That is the reason I was surprised.

Below, you can find the data file and the y vs x pltting.
You could try the 2D Joint histogram to plot these data.

Anyone else knows the reason?
Graph8.jpg Table3.txt
Ah OK. Sorry, I see what you mean. I just took your txt file and used the procedure from the exchange and saw the same thing. I don't know why.
If you are using Igor 6.3x you can put at the top of your procedure file
#include <Bivariate Histogram 2>
This will give you the WaveMetrics version - the ability to make a Bivariate Histogram from the Macros menu. I did this on your data and got only density in the correct triangle.
I think in Igor 7 there is a Joint Histogram function built-in.
bivariates.png
sjr51 wrote:
Ah OK. Sorry, I see what you mean. I just took your txt file and used the procedure from the exchange and saw the same thing. I don't know why.
If you are using Igor 6.3x you can put at the top of your procedure file
#include <Bivariate Histogram 2>
This will give you the WaveMetrics version - the ability to make a Bivariate Histogram from the Macros menu. I did this on your data and got only density in the correct triangle.
I think in Igor 7 there is a Joint Histogram function built-in.


Hi sjr51,

Thanks a lot! Although I still don't know the reason. It seems that "2D Joint histogram" from http://www.igorexchange.com/node/1373 is not very reliable. However, I learn an another power tool from you! Nice suggestion! Thanks!

with best regards