Re: [ROOT] TGraph problem

From: Olivier Couet (Olivier.Couet@cern.ch)
Date: Wed Jul 31 2002 - 14:39:35 MEST


 Hi Daniel,

 The same behaviour can be seen in PAW with the graph command. The
algorithm use to draw smooth curves in PAW and ROOT is the same. That
"bounce" effect is clearly visible with this algorithm when the graph
contains vertical lines which is the case in your example. This is not
really a bug, it is just the way the algorithm behaves. To avoid that an
other smoothing algorithm should be used.

 Cheers,     Olivier  

--
Org:    CERN - European Laboratory for Particle Physics.
Mail:   1211 Geneve 23 - Switzerland                                    
E-Mail: Olivier.Couet@cern.ch                      Phone: +41 22 7676522
WWW:    http://cern.ch/Olivier.Couet/              Fax:   +41 22 7677155

On Wed, 31 Jul 2002, Daniel De Marco wrote:

> Hi rooters,
> 
> I'm facing a problem with the "C" option of TGraph::Draw(). 
> The problem is shown by the following macro:
> {
>     double x[8];
>     double y[8];
> 
>     x[0]=1.22461e-1;
>     x[1]=0.61383;
>     x[2]=1.1547;
>     x[3]=1.45673;
>     x[4]=1.45673;
>     x[5]=1.1547;
>     x[6]=0.61383;
>     x[7]=1.22461e-1;
> 
>     y[0]=-1.4142;
>     y[1]=-1.1925;
>     y[2]=-0.81649;
>     y[3]=-0.37491;
>     y[4]=0.37491;
>     y[5]=0.81649;
>     y[6]=1.1925;
>     y[7]=1.4142;
> 
>     TCanvas *c=new TCanvas;
>     TGraph *pl=new TGraph(8, x, y);
>     c->Divide(2,1);
>     c->cd(1);
>     pl->Draw("AL");
>     c->cd(2);
>     pl->Draw("AC");
> }
> 
> In my environment this produces the plot in attachment.
> There's a way to get the curved line without the strange behaviour?
> 
> Thanks,
> Daniel.
> 
> PS: I'm using 3.03/07 18 July 2002.
> 
> --ddm
> 



This archive was generated by hypermail 2b29 : Sat Jan 04 2003 - 23:51:02 MET