Plot of a Gaussian 2d

I’m trying to draw a gaussian 2d but the plot is flat. How can I do?
Here’s my code:

#include “TGraph.h”

Double_t myfunction(Double_t x, Double_t par)
Float_t xx =x[0];
Float_t yy = x[1];
Double_t f = par[2]
return f;
TF2 *fa = new TF2(“fa”,myfunction,-15,15,-10,10,4);
void Myfunc_random() {
TCanvas *can = new TCanvas();



But I have a TF2 function. When I try to use SetParameter the terminal says “cannot use arrow operator on a type”.
Thank you for the fast answer

Try “fa->SetParameters(0., 1., 1., 0.);” right before “Draw”.

Perfect! It works well now.
Thank you so much

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.