Home | News | Documentation | Download

Appearance of point on Graph

I have a file with errors. I want to that on the canvas appear just Points, NOT line between points.
I have an example.

#include <TGraph.h>
void alo()
{
    double x[3] = {1.0, 2.0 ,3.0};
    double y[3]= {2.1, 4.1, 6.3};
    TGraph *g = new TGraph(3, x, y);
    g->Draw();
    g->SetMarkerColor(kRed);
    g->SetMarkerStyle(8);
}


Could you help me, please? Maybe, I need to change to other Class?

Use

g->Draw("AP");

https://root.cern/doc/master/classTGraphPainter.html#GP01

1 Like

Thank you. It works perfectly.