Re: [ROOT] how to plot 2 graphs in one pad?

From: David d'Enterria (enterria@in2p3.fr)
Date: Wed Mar 07 2001 - 19:56:03 MET


Hello Thomas,

En/Na Thomas Feser ha escrit:

> I tried
>         pad->cd();
>         graph1->Draw("AP");
>         graph2->Draw("SAME");
> which works in CINT, but not in my (batch mode) application. Option "SAME"
> is not documented for graphs, so I was probably just lucky to get any
> results in CINT. Is there a proper draw option to plot 2 graphs in one pad,
> preferably both with their respective markers and nothing else?

Use the option "P" for the second graph  (if you do _not_ use option "A", the
axis are _not_ drawn around the graph):
http://root.cern.ch/root/html/TGraph.html#TGraph:PaintGraph
http://root.cern.ch/root/html/examples/gerrors2.C.html

PS: This question has been asked and answered _many_ times. See e.g., the
following variations on the same theme (1997-2001) obtained from a
non-exhaustive search in the RootTalk digest:
http://root.cern.ch/cgi-bin/print_hit_bold.pl/root/roottalk/roottalk97/0099.html?graph#first_hit

http://root.cern.ch/cgi-bin/print_hit_bold.pl/root/roottalk/roottalk98/1169.html?graph#first_hit

http://root.cern.ch/cgi-bin/print_hit_bold.pl/root/roottalk/roottalk98/0209.html?graph#first_hit

http://root.cern.ch/cgi-bin/print_hit_bold.pl/root/roottalk/roottalk98/0346.html?graph#first_hit

http://root.cern.ch/cgi-bin/print_hit_bold.pl/root/roottalk/roottalk01/0269.html?graph#first_hit

http://root.cern.ch/cgi-bin/print_hit_bold.pl/root/roottalk/roottalk01/0341.html?graph#first_hit

Best regards,

--
 David D'ENTERRIA  -  Marie-Curie PostDoc Fellow  -  TAPS·PHENIX·ALICE
 Groupe Photons SUBATECH                        tel: +33 2 51 85 85 60
 4, A. Kastler BP 20722 · 44307 Nantes          fax: +33 2 51 85 84 24
 http://www-subatech.in2p3.fr/~photons        mailto:enterria@in2p3.fr
 ---------------------------------------------------------------------



This archive was generated by hypermail 2b29 : Tue Jan 01 2002 - 17:50:39 MET