Repository navigation
Expand file tree
/
Copy pathScatterPointPlot.pde
More file actions
129 lines (98 loc) · 3.18 KB
/
Copy pathScatterPointPlot.pde
File metadata and controls
129 lines (98 loc) · 3.18 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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
//plotting graph
void drawPlot(){
background(#FFFFFF); //taking into consideration black background after snowfall
strokeWeight(5);
//max temp
int counter = 0;
//if plot is on while max and min are off, show full plot
if(plot.isOn() && (!max.isOn() && !min.isOn())){
stroke(#F08C8C);
for(TemperatureData d: tempData){
point(xMin + counter, yMin - d.maxTemp*multFact );
counter+=4;
}
counter = 0;
stroke(#8CEBF0);
for(TemperatureData d: tempData){
point(xMin + counter, yMin - d.minTemp*multFact);
counter+=4;
}
}
// if plot is on while max is on, show max plot
else if(plot.isOn() && max.isOn()){
stroke(#F08C8C);
for(TemperatureData d: tempData){
point(xMin + counter, yMin - d.maxTemp*multFact );
counter+=4;
}
}
// if plot is on while min is on, show min plot
else if(plot.isOn() && min.isOn()){
stroke(#8CEBF0);
for(TemperatureData d: tempData){
point(xMin + counter, yMin - d.minTemp*multFact);
counter+=4;
}
}
axis(); //creates new axis labels
for(Button b: buttons){
if(b.isOn()){
drawPlotMonth();
}
}
}
void drawPlotMonth(){
println("hiya!~ V2");
background(#FFFFFF); //taking into consideration black background after snowfall
strokeWeight(5);
int count = 1;
int counter = 0;
for(Button a: buttons){ //check each individual button to see which one is on
if(a.isOn() && (!max.isOn() && !min.isOn())){ // when max and min are unselected
println("testing");
stroke(0xffF08C8C);
for(int x = 0; x < tempData.length; x++){
if(tempData[x].date.Month == count){
point(xMin + counter, yMin - tempData[x].maxTemp*multFact);
println("1");
}
counter+=4;
}
//min temp
counter = 0;
stroke(0xff8CEBF0);
for(int x = 0; x < tempData.length; x++){
if(tempData[x].date.Month == count){
point(xMin + counter, yMin - tempData[x].minTemp*multFact);
println("2");
}
counter+=4;
}
}
else if(a.isOn() && max.isOn()){
println("testing");
stroke(0xffF08C8C);
for(int x = 0; x < tempData.length; x++){
if(tempData[x].date.Month == count){
point(xMin + counter, yMin - tempData[x].maxTemp*multFact);
println("3");
}
counter+=4;
}
}
else if(a.isOn() && min.isOn()){
println("testing");
counter = 0;
stroke(0xff8CEBF0);
for(int x = 0; x < tempData.length; x++){
if(tempData[x].date.Month == count){
point(xMin + counter, yMin - tempData[x].minTemp*multFact);
println("4");
}
counter+=4;
}
}
count++;
}
axis();
}