I was using TGraph to graph a simple quadratic y = x*x. This is my code:
#include <chrono>
#include <fstream>
//some ROOT includes
#include "TInterpreter.h"
#include "TROOT.h"
#include "TH1F.h"
#include "TH2S.h"
#include "TFile.h"
#include "TCanvas.h"
#include "TPad.h"
#include "TVectorD.h"
#include "TGraph.h"
using std::cin;
using std::cout;
using std::endl;
void vectorGraph()
{
std::vector<Double_t> myX, myY;
auto graph = new TCanvas("quadratic","graph");
for (int i=0; i<20; i++)
{
myX.push_back((Double_t)i);
myY.push_back((Double_t)i*i);
}
TGraph* quadGraph = new TGraph(20, myX,myY);
quadGraph->Draw();
graph->Draw();
but when i ran it on root MACROS the message I recieved was: requires 0 arguments, but 3 were provided
TGraph();
ROOT Version: Not Provided
Platform: Not Provided
Compiler: Not Provided