From e0978e96854860f2cce1e8adce916d4d602d1828 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bal=C3=A1zs=20Gy=C3=B6ngy=C3=B6si?= Date: Tue, 31 Oct 2017 15:20:27 +0100 Subject: [PATCH] minor changes --- include/Plotter.hh | 2 ++ src/Plotter.cc | 30 +++++++++++++++++++++--------- 2 files changed, 23 insertions(+), 9 deletions(-) diff --git a/include/Plotter.hh b/include/Plotter.hh index 372c3ea..4522691 100644 --- a/include/Plotter.hh +++ b/include/Plotter.hh @@ -23,7 +23,9 @@ class Plotter { public: Plotter(bool draw); + ~Plotter(); void Plot(Int_t numRuns, Int_t nSteps, std::vector t, std::vector x); + TMultiGraph * GetTmultiGraph(); private: bool draw; diff --git a/src/Plotter.cc b/src/Plotter.cc index 0a944e9..0e91212 100644 --- a/src/Plotter.cc +++ b/src/Plotter.cc @@ -7,8 +7,21 @@ if(draw) { canv = new TCanvas("canc","display",800,400); } +//g1 = new TGraph(); mg = new TMultiGraph(); } + +Plotter::~Plotter() +{ + +} + +TMultiGraph * Plotter::GetTmultiGraph() +{ + return mg; +} + + void Plotter::Plot(Int_t numRuns, Int_t nSteps, std::vector t, std::vector x) { mg->SetTitle("BM1D"); @@ -16,22 +29,21 @@ void Plotter::Plot(Int_t numRuns, Int_t nSteps, std::vector t, std::ve for(int i= 0; i < numRuns; i++) { g1 = new TGraph(nSteps,&t[i*nSteps],&x[i*nSteps]); - - g1->SetLineColor(i+1); - g1->SetTitle("Brownian Movement"); - g1->GetYaxis()->SetTitle("X"); - g1->GetXaxis()->SetTitle("Time"); - g1->SetLineWidth(1); - g1->SetMarkerColor(1); + g1->SetLineColor(i%30+1); + //g1->SetTitle("Brownian Movement"); + //g1->GetYaxis()->SetTitle("X"); + //g1->GetXaxis()->SetTitle("Time"); + g1->SetLineWidth(2); + //g1->SetMarkerColor(1); g1->SetMarkerStyle(1); mg -> Add(g1); } + if(draw) { - g1->Draw(); - mg -> Draw(); + mg -> Draw("APL"); } }