Plot range on x, y axes

I have extreme difficulties changing the plot range on a scatter plot. It produces completely non-sensical variations in the x- and y-range shown on the plot. In the attached example, the plot range goes from x=-50…200 and y=0…800. I am using root_v5.10.00 compiled on my linux i686, gcc3.4.3. Also, how would I fix only one of the range limits and let the other be automatic?

I have attached the graph produced, c1.gif, from running this code:

Thank you!


void WS2(int pixel )
Char_t cuts[70], label[2];
sprintf(cuts, “channel == %i && Ssaturated==0 && Wsize>0 && Ssize>0”, pixel);

WSchannels->Draw(“Wsize:Ssize”, cuts,"*");
TGraph Graph = (TGraph)gPad->GetPrimitive(“Graph”);

TH2F htemp = (TH2F)gPad->GetPrimitive(“htemp”);

TAxis *xaxis = htemp->GetXaxis();
xaxis->SetRangeUser(0.0, 600.0 );

TAxis *yaxis = htemp->GetYaxis();

have a look at this example:

Right on! I don’t know why I didn’t find this in the class description. Thanks! Martin

[quote=“couet”]have a look at this example:[/quote]