I’m working on a simple ROOT gui with an embedded canvas. I want the histogram which is on the canvas to refresh itself every 3 seconds or so. What’s the best way to do this?
Our current application uses an infinite loop and ROOT’s sleep functionality. It works but is a little sluggish.
I’m trying to refresh an histogram each 10 seconds (I take one sample each second, that here is ramdomly generated). After 400 samples (more or less) the histogram(s) lose(s) its inherited properties (TMarkerSize, TMarkerColor, etc).
Appart from that, I’ts working fine.
I tried, of course, moving the histo
“marker” settings to different places
I think that it’s a bug, isn’t ?
Here you have a minimum sample code that reproduces the problem. bugtest.tar (20 KB)
When using TH1::SetBinContent(bin,value) and you have set the automatic rebinning option, the number of bins is automatically icreased to be >=bin.
In your case, you start with 10 bins, then get 20, 40,20,160,320,640,1280,etc.
When displaying the histogram, the paint routine detects if you have more bins than the actual resolution of your display. If it is the case, it switches automatically to the so-called “low-resolution” mode and the original attributes may not be taken into account.
You can force the painting in high resolution mode by using the option “9”