Hi Markus,
In the current development version in CVS, I have added
the following functions that should satisfy your request.
I have added two new TGraph constructors taking a TF1 as
input argument:
TGraph(const TF1 *f, Option_t *option="");
TGraph(const char *fname, Option_t *option="");
for example:
TGraph::TGraph(const TF1 *f, Option_t *option)
// Graph constructor importing its parameters from the TF1 object
// passed as argument
// if option =="" (default), a TGraph is created with points computed
// at the fNpx points of f.
// if option =="d", a TGraph is created with points computed with the
// derivative at the fNpx points of f.
// if option =="i", a TGraph is created with points computed with the
// integral at the fNpx points of f.
// if option =="I", a TGraph is created with points computed with the
// integral at the fNpx+1 points of f and the integral
// is normalized to 1.
I have added the following two functions in TF1:
void TF1::DrawDerivative(Option_t *option)
{
// Draw derivative of this function
//
// An intermediate TGraph object is built and drawn with option.
//
// The resulting graph will be drawn into the current pad.
// If this function is used via the context menu, it recommended
// to create a new canvas/pad before invoking this function.
void TF1::DrawIntegral(Option_t *option)
{
// Draw integral of this function
//
// An intermediate TGraph object is built and drawn with option.
//
// The resulting graph will be drawn into the current pad.
// If this function is used via the context menu, it recommended
// to create a new canvas/pad before invoking this function.
Access to these two functions is also available from the TF1 context
menu.
Rene Brun
On Fri, 5 Jul 2002, markus wrote:
>
> Hi all,
>
> is there a simple and fast way to plot derivatives and integrals of a TF1
> function? Integral(..) and Derivative(..) only return the value at one
> point and it takes a dedicated loop over the range of x-values to obtain
> them.
>
> Best regards,
>
> Markus Gaug
>
>
> **********************************************
> Markus Gaug
> IFAE - Insitut de Fisica d'Altes Energies
> Edifici Cn. Campus UAB.
> 08193 Cerdanyola del Valles.
> (Barcelona) SPAIN
> email: markus@ifae.es
> Tel: 00-34-93-5812839
> **********************************************
>
>
>
This archive was generated by hypermail 2b29 : Sat Jan 04 2003 - 23:50:59 MET