-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdrawAllGraphs.c
More file actions
86 lines (71 loc) · 1.94 KB
/
drawAllGraphs.c
File metadata and controls
86 lines (71 loc) · 1.94 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
void drawAllGraphs(){
ifstream variationX;
ifstream variationY;
variationX.open("variationX.txt");
variationY.open("variationY.txt");
double variationXVal;
double variationYVal;
int variationNumber=0;
int helper=0;
TGraph *variationGraph = new TGraph();
while(variationX>>variationXVal){
variationY>>variationYVal;
if(!(helper%6)){
variationGraph->SetPoint(variationNumber, variationXVal, variationYVal);
variationNumber++;
}
helper++;
}
variationX.close();
variationY.close();
variationGraph->SetTitle("Network variation ( g=3.24 )");
variationGraph->GetXaxis()->SetTitle("time");
variationGraph->GetYaxis()->SetTitle("Variation");
ifstream recX1;
ifstream recY1;
recX1.open("recX1.txt");
recY1.open("recY1.txt");
double recX1Val;
double recY1Val;
int recNumber=0;
TGraph *recGraph = new TGraph();
while(recX1>>recX1Val){
recY1>>recY1Val;
recGraph->SetPoint(recNumber, recX1Val, recY1Val);
recNumber++;
}
recX1.close();
recY1.close();
recGraph->SetTitle("Recursive Diagram ( g=3.24 )");
recGraph->GetXaxis()->SetTitle("f(t)");
recGraph->GetYaxis()->SetTitle("f(t)");
ifstream returnsMapX;
ifstream returnsMapY;
returnsMapX.open("returnsMapX.txt");
returnsMapY.open("returnsMapY.txt");
double returnsMapXVal;
double returnsMapYVal;
int returnsNumber=0;
TGraph *returnsGraph = new TGraph();
while(returnsMapX>>returnsMapXVal){
returnsMapY>>returnsMapYVal;
returnsGraph->SetPoint(returnsNumber, returnsMapXVal, returnsMapYVal);
returnsNumber++;
}
returnsMapX.close();
returnsMapY.close();
returnsGraph->SetTitle("Map of returns ( g=3.24 )");
returnsGraph->GetXaxis()->SetTitle("f(t)");
returnsGraph->GetYaxis()->SetTitle("f(t+T)");
TCanvas *c1 = new TCanvas("c1","Lab1",10,10,800,800);
c1->Divide(2,2);
c1->cd(1);
variationGraph->Draw();
c1->cd(2);
recGraph->Draw("AP");
c1->cd(3);
returnsGraph->Draw("AP");
recGraph->SetMarkerStyle(1);
returnsGraph->SetMarkerStyle(8);
//c1->update();
}