Hi Yannick,
The macro iso.C below shows two methods to achieve what you want.
Rene Brun
//-------------------------iso.C
{
//method1. compute ymax to get a commensurate range
// 1 pixel must correspond to the same range in x and y
TCanvas c1("c1","c1",10,10,800,600);
Float_t xmin = 0;
Float_t xmax = 20;
Float_t ymin = -2;
Int_t npx = gPad->GetWw();
Int_t npy = gPad->GetWh();
Float_t ymax = ymin + (xmax-xmin)*npy/npx;
TH2F h("h","",20,xmin,xmax,20,ymin,ymax);
h.Draw();
TArc a1(6,4,6);
a1.Draw();
//method2. set a square virtual canvas size in a non-square canvas
TCanvas c2("c2","c2",200,50,800,600);
c2.SetCanvasSize(700,700);
c2.DrawFrame(0,0,20,20);
TArc a2(10,10,10);
a2.Draw();
}
Patois Yannick wrote:
>
> Hi,
>
> When drawing a 2D plot, I have difficulties to impose exact
> orthonormality of the axis. I know I certainly can achieve this by
> computing length of each axis, plus looking at the pad geometry and then
> putting the scales accordingly...
>
> Is there some fast and simple way to force orthonormality, for example
> by forcing the Y axis to conform to the setting of the X axis in a
> given Pad size ?
>
> thanx for any help.
>
> Yannick
>
> --
> _/ Yannick Patois _________________ Address (home) __________________
> | irc(undernet): Garp on #france25+ | La Villa des Sciences |
> | email : patois@ganil.fr | 12, avenue de Cambridge |
> | http://garp.feelingsurfer.net/ | 14200 Herouville-Saint-Clair |
> | Tel/Fax-home:+33 (0)2 31 94 50 32 | FRANCE |
This archive was generated by hypermail 2b29 : Tue Jan 02 2001 - 11:50:32 MET