Re: drawing option for 2d plots

Rene Brun (Rene.Brun@cern.ch)
Wed, 14 May 1997 08:59:36 +0200


Wolfgang Korsch wrote:
>
> Hi,
> I would like to connect points with a line in a 2d plot.
> How can I do that?
>

If you want to superimpose a polyline on top of an existing plot
(1-d or 2-d), you can use the TGraph class.
gr = new TGraph(n, x, y)
creates a graph with the n points defined in the arrays x and y.
To draw the graph
Root > gr->Draw("L")

You could also use the TPolyLine class, but the TGraph class
has more drawing opotions and it also works for log scales.

Rene Brun