TH2F: binX size = binY size

Hi there,
It may sound a bit stupid but I cannot figure out how to plot a 2D Histogram the basis of which is a square: 1 displayed unit of X equals 1 displayed unit of Y (binX size = binY size). [I’m plotting the number of counts on a square shaped pixel detector.] The only way I’ve found is to resize my canvas:
c1->Range(x1,y1,x2,y2) ;
and tried to center it with:
c1->SetRightMargin(x) ;
My goal is to really see the square while drawing the histogram (h->Draw(“SCAT”)). [The problem is similar to that of plotting y=x and seeing the resulting straight line at 45 degrees.]
I’m pretty sure there should be a proper and easy way to do it (like in h->SetLogx() but maybe with a linear scale factor k such that h->SetLinearx(k) or whatever…)
Thanks a lot,
CU around, Zesp

If you define a square canvas you should get what you want. Can you send a small example showing your problem ?

You may get some inspiration from the script below

Rene

void makeOrtho() {
Double_t w = gPad->GetWw()*gPad->GetAbsWNDC();
Double_t h = gPad->GetWh()gPad->GetAbsHNDC();
//we fix the x range between 0 and 100 for example
//let’s compute the y range to get an orthonormal view
Double_t xmin = 0;
Double_t xmax = 100;
Double_t ymin = 0;
Double_t ymax = xmax
h/w;
gPad->Range(xmin,ymin,xmax,ymax);
}

void ortho() {
TCanvas *c1 = new TCanvas(“c1”);
c1->SetFixedAspectRatio();
makeOrtho();
TArc *arc = new TArc(50,50,10);
arc->Draw();
}