Re: Filled TPolyLines

From: Rene Brun (Rene.Brun@cern.ch)
Date: Thu Jun 04 1998 - 17:41:36 MEST


Norbert Danneberg wrote:
> 
> Hi,
> how can I draw filled (colored) TPolyLine ?
> The solution I tried draws only the line,
> no color-filled area.
> 
> {
>   gROOT->Reset();
>   Float_t x[7] = {0.2,0.3,0.3,0.2,0.1,0.1,0.2};
>   Float_t y[7] = {0.4,0.3,0.2,0.1,0.2,0.3,0.4};
>   TPolyLine *pl1 = new TPolyLine(7,x,y);
>   pl1.SetFillColor(6);
>   pl1.SetFillStyle(3008);
>   pl1.Draw();
> }
>

The class TPolyLine does not include the functions to color
the filled area. This functionality is part of the TGraph class.
I have modified your macro accordingly.

Rene Brun

{
  gROOT->Reset();
  Float_t x[7] = {0.2,0.3,0.3,0.2,0.1,0.1,0.2};
  Float_t y[7] = {0.4,0.3,0.2,0.1,0.2,0.3,0.4};
  TGraph *gr = new TGraph(7,x,y);
  gr->SetFillColor(6);  
  gr->SetFillStyle(3008);
  gr->Draw("f");
}



This archive was generated by hypermail 2b29 : Tue Jan 04 2000 - 00:34:33 MET