Overlay TGraph and TF1?

From: Cedric Sodhi <manday_at_gmx.net>
Date: Mon, 5 Apr 2010 11:17:05 +0200


Simple question: Is it possible to overlay a TGraph and a TF1 as it is with, say, two TGraphs or two Histograms, i.e. draw one fully and the other without axes?

I appear not to be able to draw two of them into the same Coordsys:

TGraph myg( 20 );
for( int i = 0; i<20; i++ ) myg->SetPoint( i,i,i + rand( )%4 ); myg.Draw( "AL" );
TF1 myf( "myf","x+sin(x)",0,20 );
myf.Draw( );

In order to display a graph and a function (e.g. the expectation) in the same TPad, do I have to make a TGraph out of the function?

Thanks! Received on Mon Apr 05 2010 - 11:17:11 CEST

This archive was generated by hypermail 2.2.0 : Mon Apr 05 2010 - 17:50:01 CEST