Hi Roger!
On 23 Jan 2007, at 16:30, Roger Mason wrote:
> Hello,
>
> I have an elementary question: how to get a TGraph from a file.
>
> I save a TGraph object to a file. I can open the file and verify that
> the TGraph is present:
>
> root [5] TFile f("file1.txt.root","UPDATE")
> root [6] .ls
> TFile** file1.txt.root
> TFile* file1.txt.root
> KEY: TGraph Graph;1 Original data
>
> I recover the TGraph:
>
> root [7] Graph->Draw()
> <TCanvas::MakeDefCanvas>: created default TCanvas with name c1
>
> but the canvas is empty.
>
TGraph::Draw() doesn't do much without a draw option. Try Graph->Draw
("ap").
This behaviour of TGraph is quite counter-intuitive. Is there a reason why the option string does not have a default containing at least "ap"?
Ciao,
Roland
-- TU Muenchen, Physik-Department E18, James-Franck-Str., 85748 Garching Telefon 089/289-12575; Telefax 089/289-12570 -- CERN office: 892-1-D23 phone: +41 22 7676540 mobile: +41 76 487 4482 -- Any society that would give up a little liberty to gain a little security will deserve neither and lose both. - Benjamin Franklin -----BEGIN GEEK CODE BLOCK----- Version: 3.12 GS/CS/M/MU d-(++) s:+ a-> C+++ UL++++ P+++ L+++ E(+) W+ !N K- w--- M + !V Y+ PGP++ t+(++) 5 R+ tv-- b+ DI++ e+++>++++ h---- y+++ ------END GEEK CODE BLOCK------Received on Tue Jan 23 2007 - 19:04:18 CET
- application/pkcs7-signature attachment: smime.p7s
- application/pgp-signature attachment: This is a digitally signed message part
This archive was generated by hypermail 2.2.0 : Wed Jan 24 2007 - 17:50:01 CET