Hello!
I’m trying to draw a gaussian 2d but the plot is flat. How can I do?
Here’s my code:
#include
#include
#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]((exp(-0.5((xx-par[0])/par[1])((xx-par[0])/par[1])))exp(-0.5((yy-par[3])/par[1])((yy-par[3])/par[1])));
return f;
}
TF2 *fa = new TF2(“fa”,myfunction,-15,15,-10,10,4);
void Myfunc_random() {
TCanvas *can = new TCanvas();
fa->Draw(“surf”);
}