I encountered an unbelievable phenomenon when I refreshed the OS of my PC a few days ago. My data plotted as a 2D graph looked totally strange.
First I thought the data were wrong, but the older system plots the correct graph from the same data. The attached image “old.gif” is the one plotted on the old system, and “new.gif” is on the new system. The latter shows some spikes although none of the Z-values of the data points is above 50 as you can see from the script “graph2d.C”. The difference is also obvious when I plotted the data with other options such as “surf” and “cont4”.
The new system is CentOS 5.4 and the old system is a japanese-localized Linux based on Fedora. I wonder if the external libraries on the new system are leading to the wrong view of the graph because the ROOT versions of the old and new system are the same: 5.24/00b.
Could you tell me what I should look into to fix this problem?
I would really appreciate your help! graph2d.C (18.6 KB)
My Mac system gives me a picture with peaks also different from yours but also peaks. So I will debug there. It might be a difference of binning … not sure…I’ll investigate and let you know.
It looks like that, at filling time, due to the position of your points which are placed regularly on a grid, several points fall in the same bin in some cases and do not in some others.
That’s a rounding effect. By default the number of bins of the underlying histogram is 40x40. To break the fact the points lie on the regular grid I simply did: graph2d->SetNpx(41);
Thank you very much for your help.
Is there any general solution to avoid this rounding effect?
I thought that just increasing the number of bins could work out, but
setting the same number to Npx and Npy always seems to cause the peaking
regardless of the number.
I also wonder why this effect is system-dependent?
It is very well known that you should never fill histograms at the bin boundaries.
When creating histograms holding integers, never create a histogram like
but do
to make sure that your bins are multiple of integer values. Then never fill at the bin edge, but
do something like
Hello,
For the time being use the workaround I gave you. I traced the problem up to TGraphDelaunay::InterpolateOnPlane. Something can be done there I think but I have not yet found what exactly. I need more time to understand what to do.
O.
[quote=“brun”]It is very well known that you should never fill histograms at the bin boundaries.
[/quote]
I do not think that explains this case.
The plot screwed up despite setting the binning not to fill the data points at the bin boundaries by