exactly where the minimum off the Function is. I have everything computed and know where to location of the minimum is, but can’t manage to get any marker into the plot.
A rough sketch of my code is:
void(){
int N=0;
int minx=0; int miny=0; int minz=0;
TGraph2D *dt4;
dt4 = new TGraph2D();
// Fill Graph
for (Double_t m=-1000.; m<1000.; m+=100) {
for (Double_t A=0; A<3; A+=0.05) {
z = some_function(some_parameters);
dt4->SetPoint(N,m,A,z);
N++;
if (z < minz){ // Look for minimum
minz = z;
minx = m;
miny = A;
}
}
}
// Transform to hist
hist4 = dt4->GetHistogram();
// Plot
hist4->SetContour(20);
hist4->Draw("CONT4Z");
c4->Draw();
}
Hi @lnies, welcome here.
This is the simplest idea that came to my mind, maybe there are smarter way to do it.
Declare a new TGraph and add just one point, then change the marker to a star and draw it.
Below just a simple way to implement it.
TGraph *min = new TGraph();
min->SetPoint(0,minx,miny);
min->SetMarkerStyle(29);
min->SetMarkerColor(kRed);
min->Draw("Psame");