Online Display

Hello,

I tried to write an online display for a TGraph. It is no problem to draw the data periodically. But when I zoomed the TGraph and then the new data are displayed the graph is unzoomed automatically. I want only the data to be changed but not the displayed range of the graph. Thus one should see the points moving in the zoomed graph. To solve the problem I miss something like GetRangeUser of TAxis (according to SetRangeUser). Does anyone can help me?

You should call TGraph::Draw again and again, just gPad->Modified();
gPad->Update();

Rene

Hello,

following up this old thread, I actually have a similar problem. However, in my case, I would like to set the range of a graph (TAxis->SetRangeUser(…)) based on the currently set range, i.e. I have to access the currently displayed axis limits. Something like TAxis->GetRangeUser() does not seem to exist and the only workaround I found up to know is

GetXaxis()->GetBinLowEdge(GetXaxis()->GetFirst());

for the lower limit, for example. However, this seems rather clumsy and only approximate to me. What would be the correct way to achieve this?

Thanks in advance!

Could you post the shortest possible RUNNING script showing your problem?

Rene

Well, it is not really a problem which I can show to you in a script. It was rather a question:

How can I access the currently displayed access range of a TGraph?

Before calling TGraph::GetXaxis() you must force the painting of the canvas

canvas->Update(); mygraph->GetXaxis()->...
Rene