OKUMURA, Akira | 1 Apr 2009 15:06
Picon
Favicon

[ROOT] Changing canvas size

Hello ROOTers,

How can I change the size of a canvas before printing it? The sizes of  
c1.png and c2.png are different in the following example.

$ cat can.C
{
   Double_t w = 600;
   Double_t h = 600;
   TCanvas * c1 = new TCanvas("c", "c", w, h);
   c->SetWindowSize(w + (w - c->GetWw()), h + (h - c->GetWh()));
   c->SaveAs("c1.png");
   c->SaveAs("c2.png");
}

$ root
root [0] .x c.C
Info in <TCanvas::Print>: file c1.png has been created
Info in <TCanvas::Print>: file c2.png has been created
root [1] .q
$ file c1.png c2.png
c1.png: PNG image data, 596 x 572, 8-bit/color RGB, non-interlaced
c2.png: PNG image data, 600 x 600, 8-bit/color RGB, non-interlaced

Regards,

OKUMURA, Akira oxon <at> ceres.phys.s.u-tokyo.ac.jp
Department of Physics, The University of Tokyo
7-3-1 Hongo, Bunkyo-ku, Tokyo 113-0033
TEL/FAX +81 3-5841-4173/4059
(Continue reading)

Olivier Couet | 1 Apr 2009 15:24
Picon
Picon

RE: [ROOT] Changing canvas size

I agree, that is weird. I get also two different sizes:

$ ls -l *.png
-rwxr-xr-x 1 Olivier None 2261 Apr  1 15:22 c1.png
-rwxr-xr-x 1 Olivier None 2382 Apr  1 15:22 c2.png

They should be the same.....

-----Original Message-----
From: owner-roottalk <at> root.cern.ch [mailto:owner-roottalk <at> root.cern.ch] On Behalf Of OKUMURA, Akira
Sent: Wednesday, April 01, 2009 3:07 PM
To: roottalk (Mailing list discussing all aspects of the ROOT system.)
Subject: [ROOT] Changing canvas size

Hello ROOTers,

How can I change the size of a canvas before printing it? The sizes of
c1.png and c2.png are different in the following example.

$ cat can.C
{
   Double_t w = 600;
   Double_t h = 600;
   TCanvas * c1 = new TCanvas("c", "c", w, h);
   c->SetWindowSize(w + (w - c->GetWw()), h + (h - c->GetWh()));
   c->SaveAs("c1.png");
   c->SaveAs("c2.png");
}

$ root
(Continue reading)

Olivier Couet | 1 Apr 2009 15:31
Picon
Picon

RE: [ROOT] TAxis. Exponential notation for every label.

Hi Dmitry,

It was not implemented in TGaxis::PaintAxis (see the code).
This method comes from the igaxis cernlib routine and at that time
only the x10 at the end of the axis was a requirement for linear
axis. The exponant for labels reserved for log axis. The only
way for you to bypass it with the existing code would be to
define alphanumeric labels and set the labels yourself. But 
that's really heavy....

Cheers,   Olivier

-----Original Message-----
From: naumov <at> numail.jinr.ru [mailto:naumov <at> numail.jinr.ru] 
Sent: Wednesday, April 01, 2009 3:25 PM
To: Olivier Couet; gonchar <at> nusun.jinr.ru; roottalk <at> lxbuild091.cern.ch; naumov <at> nusun.jinr.ru
Subject: RE: [ROOT] TAxis. Exponential notation for every label.

Dear Olivier,
Why this is not possible on lin scale as well?
Dmitry

3/27/2009, "Olivier Couet" <Olivier.Couet <at> cern.ch> вы писали:

>On log scale yes. On linear axis the exponent is put at the end of the
>axis.
>
>-----Original Message-----
>From: owner-roottalk <at> root.cern.ch [mailto:owner-roottalk <at> root.cern.ch]
>On Behalf Of Maxim Gonchar
(Continue reading)

Fine, Valeri | 1 Apr 2009 15:41
Favicon

RE: [ROOT] Changing canvas size

Hello Olivier, 

> I agree, that is weird. I get also two different sizes:

One size is the size of the widget including the  frame decoration, another is the size of the TPad image.

 
Thank you, Valeri

________________________________

From: owner-roottalk <at> root.cern.ch on behalf of Olivier Couet
Sent: Wed 4/1/2009 9:24 AM
To: OKUMURA, Akira; roottalk (Mailing list discussing all aspects of the ROOT system.)
Subject: RE: [ROOT] Changing canvas size

I agree, that is weird. I get also two different sizes:

$ ls -l *.png
-rwxr-xr-x 1 Olivier None 2261 Apr  1 15:22 c1.png
-rwxr-xr-x 1 Olivier None 2382 Apr  1 15:22 c2.png

They should be the same.....

-----Original Message-----
From: owner-roottalk <at> root.cern.ch [mailto:owner-roottalk <at> root.cern.ch] On Behalf Of OKUMURA, Akira
Sent: Wednesday, April 01, 2009 3:07 PM
To: roottalk (Mailing list discussing all aspects of the ROOT system.)
Subject: [ROOT] Changing canvas size

(Continue reading)

Olivier Couet | 1 Apr 2009 15:44
Picon
Picon

RE: [ROOT] Changing canvas size

Yes Valeri we saw that ... but why ? the two prints are just one after each other logically they should be the same.
BTW I just tried:

{
   Double_t w = 600;
   Double_t h = 600;
   TCanvas * c1 = new TCanvas("c", "c", w, h);
   c1->Draw();
   gPad->Modified();
   gPad->Update();
   c->SetWindowSize(w + (w - c->GetWw()), h + (h - c->GetWh()));
   c->SaveAs("c1.png");
   c->SaveAs("c2.png");
}

But I get the same.

-----Original Message-----
From: Fine, Valeri [mailto:fine <at> bnl.gov]
Sent: Wednesday, April 01, 2009 3:42 PM
To: Olivier Couet; OKUMURA, Akira; roottalk (Mailing list discussing all aspects of the ROOT system.)
Subject: RE: [ROOT] Changing canvas size

Hello Olivier,

> I agree, that is weird. I get also two different sizes:

One size is the size of the widget including the  frame decoration, another is the size of the TPad image.

Thank you, Valeri
(Continue reading)

Fine, Valeri | 1 Apr 2009 15:53
Favicon

RE: [ROOT] Changing canvas size

To show where the problem comes from I've  run Akira's example with Qt-plugin on and got both images 600 x 600.
( I tested this on windows. I'll check on Linux later)

 Hope this helps, Valeri 

________________________________

From: owner-roottalk <at> root.cern.ch on behalf of Fine, Valeri
Sent: Wed 4/1/2009 9:41 AM
To: Olivier Couet; OKUMURA, Akira; roottalk (Mailing list discussing all aspects of the ROOT system.)
Subject: RE: [ROOT] Changing canvas size

Hello Olivier,

> I agree, that is weird. I get also two different sizes:

One size is the size of the widget including the  frame decoration, another is the size of the TPad image.

Thank you, Valeri

________________________________

From: owner-roottalk <at> root.cern.ch on behalf of Olivier Couet
Sent: Wed 4/1/2009 9:24 AM
To: OKUMURA, Akira; roottalk (Mailing list discussing all aspects of the ROOT system.)
Subject: RE: [ROOT] Changing canvas size

I agree, that is weird. I get also two different sizes:

$ ls -l *.png
(Continue reading)

Fine, Valeri | 1 Apr 2009 15:59
Favicon

RE: [ROOT] Changing canvas size


> Yes Valeri we saw that ... but why ? the two prints are just one after
> each other logically they should be the same.

SetWindowSize changes the size of the window via Window manager. It may take time and happen between the
first and second SaveAs invocations. (The real outcome is defined but the CPU + Network + etc factors)

Valeri

________________________________

From: Olivier Couet [mailto:Olivier.Couet <at> cern.ch]
Sent: Wed 4/1/2009 9:44 AM
To: Fine, Valeri; OKUMURA, Akira; roottalk (Mailing list discussing all aspects of the ROOT system.)
Subject: RE: [ROOT] Changing canvas size

Yes Valeri we saw that ... but why ? the two prints are just one after
each other logically they should be the same.
BTW I just tried:

{
   Double_t w = 600;
   Double_t h = 600;
   TCanvas * c1 = new TCanvas("c", "c", w, h);
   c1->Draw();
   gPad->Modified();
   gPad->Update();
   c->SetWindowSize(w + (w - c->GetWw()), h + (h - c->GetWh()));
   c->SaveAs("c1.png");
   c->SaveAs("c2.png");
(Continue reading)

lopez | 1 Apr 2009 18:33
Picon
Picon
Favicon

[ROOT] Fwd: rootcint problem


Dear all,

I'm trying to create a ROOT dictionary using a class that links some ITK
libraries.
I builded ITK and i have copied all the includes  in  the directory
./include/ .

I'm using a root 5.23/02 on ubuntu Intrepid

When i run the rootcint program i receive the following output.
I'll be very grateful if someone can give me some hints about that.

Best Regards

rootcint -f n1Cint.cc -c   -I./include/ prova.h n1LinkDef.h

*** buffer overflow detected ***: rootcint terminated
======= Backtrace: =========
/lib/tls/i686/cmov/libc.so.6(__fortify_fail+0x48)[0xb77206d8]
/lib/tls/i686/cmov/libc.so.6[0xb771e800]
/lib/tls/i686/cmov/libc.so.6[0xb771def8]
/lib/tls/i686/cmov/libc.so.6(_IO_default_xsputn+0xc8)[0xb7693a78]
/lib/tls/i686/cmov/libc.so.6(_IO_vfprintf+0x371b)[0xb76690db]
/lib/tls/i686/cmov/libc.so.6(__vsprintf_chk+0xa4)[0xb771dfa4]
/lib/tls/i686/cmov/libc.so.6(__sprintf_chk+0x2d)[0xb771deed]
/home/alienmaster/magic5/root/v5-23-02/lib/libCint.so(G__define_var+0x18ee)[0xb7942d3e]
/home/alienmaster/magic5/root/v5-23-02/lib/libCint.so(G__define_struct+0x1d6f)[0xb7a46e0f]
/home/alienmaster/magic5/root/v5-23-02/lib/libCint.so(G__exec_statement+0xa9a3)[0xb79ee5e3]
/home/alienmaster/magic5/root/v5-23-02/lib/libCint.so(G__define_struct+0x1fd2)[0xb7a47072]
(Continue reading)

Axel Naumann | 1 Apr 2009 21:21
Picon
Picon

Re: [ROOT] Fwd: rootcint problem

Hi,

I assume you pass several headers to rootcint. Can you reduce the number
of headers, until you find the one that causes the buffer overflow? The
attachment was quarantined, but sending that one single header should work.

I don't know what build you are using, but if you have rootcint7
(instead of rootcint) in $ROOTSYS/bin you can try with that one, too -
it has a much improved stack handling and will most probably not cause
an overflow.

Cheers, Axel.

On 2009-04-01 18:33, lopez <at> to.infn.it wrote:
> Dear all,
> 
> I'm trying to create a ROOT dictionary using a class that links some ITK
> libraries.
> I builded ITK and i have copied all the includes  in  the directory
> ./include/ .
> 
> 
> 
> I'm using a root 5.23/02 on ubuntu Intrepid
> 
> 
> 
> 
> When i run the rootcint program i receive the following output.
> I'll be very grateful if someone can give me some hints about that.
(Continue reading)

OKUMURA, Akira | 2 Apr 2009 03:05
Picon
Favicon

Re: [ROOT] Changing canvas size

Hello Valeri and Olivier,

I modified the macro to wait for a while, but the result is the same.  
Any idea? I'm using ROOT 5.23 + OS X Leopard + X11.app + default  
window manager.

root [9] .x c.C
Info in <TCanvas::Print>: file c1.png has been created
Info in <TCanvas::Print>: file c2.png has been created
c1.png: PNG image data, 596 x 572, 8-bit/color RGB, non-interlaced
c2.png: PNG image data, 600 x 600, 8-bit/color RGB, non-interlaced

{
   Double_t w = 600;
   Double_t h = 600;
   TCanvas * c1 = new TCanvas("c", "c", w, h);
   c1->Draw();
   c->SetWindowSize(w + (w - c->GetWw()), h + (h - c->GetWh()));
   gPad->Modified();
   gPad->Update();

   gSystem->Sleep(10000);
   for(int i = 0; i < 100000000; i++){
     double a = i*i*i;
   }

   c->SaveAs("c1.png");
   c->SaveAs("c2.png");
   gSystem->Exec("file c1.png c2.png");
}
(Continue reading)


Gmane