Hi,
I guess what you do not like is the overlapping labels on the axis on top ? When you use a TGaxis with tick marks placed according to a function there is no labeling optimization performed. Therefore you can sometimes get such situation. I tried a few things to try to improve it but none of them are really satisfactory. Do you have an picture showing the kind of plot you would like ?
Cheers, O.Couet
Date: Fri, 02 Nov 2007 22:52:27 +0900 (JST)
From: Kazuyoshi Furutaka <furutaka_at_jb3.so-net.ne.jp>
To: roottalk_at_pcroot.cern.ch
Subject: [ROOT] how to add additional (energy) abscissa to a TOF
spectrum?
Dear rooters,
How can I add additional abscissa (energy scale) to a
time-of-flight spectrum?
For 10-m neutron TOF I wrote the attached by using TGaxis,
but it's apparently failing...
Thanks in advance,
Kazuyoshi
-- Kazuyoshi Furutaka furutaka_at_jb3.so-net.ne.jp [ Part 2.2: "twoAbscissa.C" ] { gStyle->SetOptStat(0); TH1F* tof = new TH1F("tof","10-m neutron TOF: E(eV)=(72.3*10(m)/TOF(#mus))^2", 90,10.0,100.0); tof->GetYaxis()->SetRangeUser(0,10); tof->GetXaxis()->SetTitle("neutron TOF (#mus)"); tof->Draw(); TF1* fEne = new TF1("fEne","pow(72.3*10.0/x,2)",10.0,100.0); TGaxis* energyAxis = new TGaxis(10,10,100,10,"fEne",510,"-"); energyAxis->SetTitle("energy (eV)"); energyAxis->Draw(); } -- Org: CERN - European Laboratory for Particle Physics. Mail: 1211 Geneve 23 - Switzerland Mailbox: J25910 E-Mail: Olivier.Couet_at_cern.ch Phone: +41 22 7676522 WWW: http://cern.ch/Olivier.Couet/ Fax: +41 22 7670300Received on Mon Nov 05 2007 - 13:45:21 CET
This archive was generated by hypermail 2.2.0 : Mon Nov 05 2007 - 17:50:01 CET