Based on last CSV file, I rearranged the checkout number of each categories "Comic book entire", "American comic book", "Japanese comic book", and "Harry Potter"related books. The goal of this assignment was manipulate the arrangement to find out some kinds of relationship between number of book check out to weather in Seattle. There are three buttons in the rendering. I put the average high temperature and average precipitation in Seattle of the last severals decades. I was able to find it there was increasing when the temperature was high and precipitation was low.
The color is matching with each month's temperature and precipitation. You can see that during winter period, there were decreasing of check outs. I would said that this indicate that people like to go to library when the weather is nice.
I also need to do more invention the button and slide to show the exact connection between different integers.
Code: Select all
//MAT 259 Visualizing Information homework3 1 Feb 2015 Intae Hwang
//
//http://www.perbang.dk/rgbgradient// color code
//http://www.sojamo.de/libraries/controlP5/ button control library
import controlP5.*;
ControlP5 cp5;
int myColor = color(255);
int c1,c2;
float n,n1;
import processing.data.StringList;
import org.apache.tools.ant.types.resources.comparators.Date;
PFont myFont;
PFont myFont1;
int [][] dataMatrix = null;
String [][] dataMatrix1 = null;
int ballR = 400;
int maxCount;
int numRows, numColumns;
int xPosition = 20;
int yearcut = 12;
int ycut = 5;
int cellwidth = 8;
int cellheight = 13;
PFont font= createFont("Helvetica",16,true);
PFont font_1;
Table myTable;
int numMonth = 11;
boolean averHighOver = false;
boolean averPrecipOver = false;
boolean Number1 = true;
float angle = 0.03; //rotation value
float Angle = 0.00;
float transX = 0.01; //tranlsate value
float transY = 0.01;
float trans1 = 0.00;
float trans2 = 0.00;
int numRows1 = 0;
int year2 = 2006;
//////average high temperature from Jan to Dec in Seattle
float[] aveHigh = {46,50,53,58,64,70,75,76,70,60,51,46};
float maxHigh = max(aveHigh);
float minHigh = min(aveHigh);
int numcolormode1 = 11;
int[] colormode = {
#DBDB8F,#DBC783,#DBB377,#DB9F6B,#DC8C60,#DC7854,#DC6448
,#DC503C,#DD3D31,#DD2925,#DD1519,#DE020E};
//////average precipitation from Jan to Dec in Seattle
float[] avePrecip = {5.13,4.18,3.75,2.59,1.78,1.49,0.79,1.02,1.63,3.19,5.90,5.62};
float maxPrecip = max(avePrecip);
float minPrecip = min(avePrecip);
int[] colormode1 = {
#ADFFFF,#9DE8F2,#8DD2E5,#7DBBD9,#6EA5CC,#5E8EC0,#4E78B3
,#3E61A7,#2F4B9A,#1F348E,#0F1E81,#000875
};
void setup()
{
size(1340,1260);
smooth();
noStroke();
myFont =createFont("Helvetica", 38);
textFont(myFont);
myTable = new Table();
myTable = loadTable( "data06-13-3.csv", "header");
numRows = myTable.getRowCount();
numColumns = myTable.getColumnCount();
dataMatrix = new int[numRows][numColumns];
for (int i = 0; i < numRows; i ++)
{
for ( int j = 0; j < numColumns; j ++)
{
dataMatrix[i][j] = myTable.getInt(i,j);
}
}
maxCount = dataMatrix[0][0];
for (int i = 0; i < numRows; i ++)
{
for ( int j = 1; j < numColumns; j ++)
{
if (dataMatrix[i][j] > maxCount)
maxCount = dataMatrix[i][j];
}
}
//////////////////button and slide/////////////////
cp5 = new ControlP5(this);
translate(width/2,400);{
cp5.addSlider("Month")
.setPosition(80,45)
.setSize(800,20)
.setRange(1,96)
.setValue(1)
;
cp5.addSlider("ANGLE")
.setPosition(80,70)
.setSize(200,20)
.setRange(0,200)
.setValue(0)
;
cp5.addSlider("transX")
.setPosition(80,95)
.setSize(200,20)
.setRange(0,200)
.setValue(0)
;
cp5.addSlider("transY")
.setPosition(80,120)
.setSize(200,20)
.setRange(0,200)
.setValue(0)
;
cp5.addButton("Ave_Temp_High")
.setValue(0)
.setPosition(80,160)
.setSize(200,19)
;
cp5.addButton("Ave_Precip")
.setValue(100)
.setPosition(80,185)
.setSize(200,19)
;
cp5.addButton("Number")
.setPosition(80,210)
.setSize(200,19)
.setValue(0)
;
}
}
public void controlEvent(ControlEvent theEvent) {
n = 0;
}
public void Ave_Temp_High() {
averHighOver = true;
averPrecipOver = false;
}
public void Ave_Precip() {
averPrecipOver = true;
averHighOver = false;
}
public void Number() {
Number1 = !Number1;
}
void draw()
{
background(104);
pushMatrix();
translate(width/2,400);
for(int q = 0; q < 12; q++){
color x = colormode[q];
fill(x);
rect(400+q*20,-300,20,20);
color z = colormode1[q];
fill(z);
rect(400+q*20,-350,20,20);
}
textSize(15);
textAlign(CENTER);
fill(colormode[0]);
text(minHigh,400,-307);
fill(colormode[11]);
text(maxHigh,640,-307);
fill(colormode[0]);
textAlign(LEFT);
text("Temperature",310,-285);
textSize(15);
textAlign(CENTER);
fill(colormode1[0]);
text(minPrecip,400,-357);
fill(colormode1[11]);
text(maxPrecip,640,-357);
fill(colormode1[0]);
textAlign(LEFT);
text("Precipitation",310,-335);
textSize(35);
text("Comicbook\nCheckout\n+\nWeather\n2006-\n2013",-600,000);
//ellipse(dataMatrix[i][j]/80,dataMatrix[i][j]/280,dataMatrix[i][j]/ballR,dataMatrix[i][j]/ballR);
//ellipse(dataMatrix[i][j]/80,dataMatrix[i][j]/280,dataMatrix[i][j]/ballR,dataMatrix[i][j]/ballR);
ellipse(600,-200,41029/ballR,41029/ballR);
fill(0);
textAlign(CENTER,CENTER);
textSize(15);
text("41259",600,-130);
fill(#000875);
ellipse(420,-200,2825/ballR,2825/ballR);
fill(0);
textAlign(CENTER,CENTER);
textSize(15);
text("2825",420,-130);
fill(#4E78B3);
ellipse(495,-200,20093/ballR,20093/ballR);
fill(0);
textAlign(CENTER,CENTER);
textSize(15);
text("20093",495,-130);
for(int z = 0; z < 9; z++){
textSize(12);
fill(#FFFFFF);
text(year2+z,-590+z*100,-370);
}
for(int i = 0; i <numRows1; i++)
{
for(int j = 1; j <numColumns; j++)
{
for(int p = 0; p <numMonth; p ++)
{
colorMode(HSB,360,100,100);
if(dataMatrix[i][0] == 1 && averHighOver == true){
float High = map(aveHigh[0],minHigh,maxHigh,0,numcolormode1);
float d = High;
int c = round(d);
color x = colormode[c];
fill(x,33);
}
else if(dataMatrix[i][0] == 2 && averHighOver == true){
float High = map(aveHigh[1],minHigh,maxHigh,0,numcolormode1);
float d = High;
int c = round(d);
color x = colormode[c];
fill(x,33);}
else if(dataMatrix[i][0] == 3 && averHighOver == true){
float High = map(aveHigh[2],minHigh,maxHigh,0,numcolormode1);
float d = High;
int c = round(d);
color x = colormode[c];
fill(x,33);}
else if(dataMatrix[i][0] == 4 && averHighOver == true){
float High = map(aveHigh[3],minHigh,maxHigh,0,numcolormode1);
float d = High;
int c = round(d);
color x = colormode[c];
fill(x,33);}
else if(dataMatrix[i][0] == 5 && averHighOver == true){
float High = map(aveHigh[4],minHigh,maxHigh,0,numcolormode1);
float d = High;
int c = round(d);
color x = colormode[c];
fill(x,33);}
else if(dataMatrix[i][0] == 6 && averHighOver == true){
float High = map(aveHigh[5],minHigh,maxHigh,0,numcolormode1);
float d = High;
int c = round(d);
color x = colormode[c];
fill(x,33);}
else if(dataMatrix[i][0] == 7 && averHighOver == true){
float High = map(aveHigh[6],minHigh,maxHigh,0,numcolormode1);
float d = High;
int c = round(d);
color x = colormode[c];
fill(x,33);}
else if(dataMatrix[i][0] == 8 && averHighOver == true){
float High = map(aveHigh[7],minHigh,maxHigh,0,numcolormode1);
float d = High;
int c = round(d);
color x = colormode[c];
fill(x,33);}
else if(dataMatrix[i][0] == 9 && averHighOver == true){
float High = map(aveHigh[8],minHigh,maxHigh,0,numcolormode1);
float d = High;
int c = round(d);
color x = colormode[c];
fill(x,33);}
else if(dataMatrix[i][0] == 10 && averHighOver == true){
float High = map(aveHigh[9],minHigh,maxHigh,0,numcolormode1);
float d = High;
int c = round(d);
color x = colormode[c];
fill(x,33);}
else if(dataMatrix[i][0] == 11 && averHighOver == true){
float High = map(aveHigh[10],minHigh,maxHigh,0,numcolormode1);
float d = High;
int c = round(d);
color x = colormode[c];
fill(x,33);}
else if(dataMatrix[i][0] == 12 && averHighOver == true){
float High = map(aveHigh[11],minHigh,maxHigh,0,numcolormode1);
float d = High;
int c = round(d);
color x = colormode[c];
fill(x,33);}
else if(dataMatrix[i][0] == 1 && averPrecipOver == true){
float High = map(avePrecip[0],minPrecip,maxPrecip,0,numcolormode1);
float d = High;
int c = round(d);
color x = colormode1[c];
fill(x,33);}
else if(dataMatrix[i][0] == 2 && averPrecipOver == true){
float High = map(avePrecip[1],minPrecip,maxPrecip,0,numcolormode1);
float d = High;
int c = round(d);
color x = colormode1[c];
fill(x,33);}
else if(dataMatrix[i][0] == 3 && averPrecipOver == true){
float High = map(avePrecip[2],minPrecip,maxPrecip,0,numcolormode1);
float d = High;
int c = round(d);
color x = colormode1[c];
fill(x,33);}
else if(dataMatrix[i][0] == 4 && averPrecipOver == true){
float High = map(avePrecip[3],minPrecip,maxPrecip,0,numcolormode1);
float d = High;
int c = round(d);
color x = colormode1[c];
fill(x,33);}
else if(dataMatrix[i][0] == 5 && averPrecipOver == true){
float High = map(avePrecip[4],minPrecip,maxPrecip,0,numcolormode1);
float d = High;
int c = round(d);
color x = colormode1[c];
fill(x,33);}
else if(dataMatrix[i][0] == 6 && averPrecipOver == true){
float High = map(avePrecip[5],minPrecip,maxPrecip,0,numcolormode1);
float d = High;
int c = round(d);
color x = colormode1[c];
fill(x,33);}
else if(dataMatrix[i][0] == 7 && averPrecipOver == true){
float High = map(avePrecip[6],minPrecip,maxPrecip,0,numcolormode1);
float d = High;
int c = round(d);
color x = colormode1[c];
fill(x,33);}
else if(dataMatrix[i][0] == 8 && averPrecipOver == true){
float High = map(avePrecip[7],minPrecip,maxPrecip,0,numcolormode1);
float d = High;
int c = round(d);
color x = colormode1[c];
fill(x,33);}
else if(dataMatrix[i][0] == 9 && averPrecipOver == true){
float High = map(avePrecip[8],minPrecip,maxPrecip,0,numcolormode1);
float d = High;
int c = round(d);
color x = colormode1[c];
fill(x,33);}
else if(dataMatrix[i][0] == 10 && averPrecipOver == true){
float High = map(avePrecip[9],minPrecip,maxPrecip,0,numcolormode1);
float d = High;
int c = round(d);
color x = colormode1[c];
fill(x,33);}
else if(dataMatrix[i][0] == 11 && averPrecipOver == true){
float High = map(avePrecip[10],minPrecip,maxPrecip,0,numcolormode1);
float d = High;
int c = round(d);
color x = colormode1[c];
fill(x,33);}
else if(dataMatrix[i][0] == 12 && averPrecipOver == true){
float High = map(avePrecip[11],minPrecip,maxPrecip,0,numcolormode1);
float d = High;
int c = round(d);
color x = colormode1[c];
fill(x,33);}
//textSize(14);
//textAlign(BOTTOM);
//text(dataMatrix[i][j],dataMatrix[i][j]/80,dataMatrix[i][j]/280);
ellipse(dataMatrix[i][j]/80,dataMatrix[i][j]/280,dataMatrix[i][j]/ballR,dataMatrix[i][j]/ballR);
}
translate(transX*trans1,transY*trans2);
rotate(angle*Angle);
if(Number1 == true){
textSize(14);
textAlign(CENTER);
fill(88);
text(dataMatrix[i][j],dataMatrix[i][j]/80,dataMatrix[i][j]/280);
}
}
}
popMatrix();
//save("hw3-7.jpg");
}
void ANGLE(float theColor) {
Angle = theColor/200;
}
void transX(float theColor) {
trans1 = theColor*2;
}
void transY(float theColor) {
trans2 = theColor*1;
}
void Month(int theColor){
numRows1 = theColor;
}
I did more work after I got feedback from the class. I moved the legends to left and give more space for rotating bubbles, then minimize the span and size of the balls to make them fit into the chart, but it lost the variety at the same time.
I got the temperature information form the Seattle official website.
http://www.seattle.gov/living-in-seattl ... nd-records
Also , for the color pick, I visit this website.
http://www.perbang.dk/rgbgradient/
Code: Select all
/MAT 259 Visualizing Information homework3 1 Feb 2015 Intae Hwang
//
//http://www.perbang.dk/rgbgradient// color code
//http://www.sojamo.de/libraries/controlP5/ button control library
import controlP5.*;
ControlP5 cp5;
int myColor = color(255);
int c1,c2;
float n,n1;
import processing.data.StringList;
import org.apache.tools.ant.types.resources.comparators.Date;
PFont myFont;
PFont myFont1;
int [][] dataMatrix = null;
String [][] dataMatrix1 = null;
int ballR = 500;
int maxCount;
int numRows, numColumns;
int xPosition = 20;
int yearcut = 12;
int ycut = 5;
int cellwidth = 8;
int cellheight = 13;
PFont font= createFont("Helvetica",16,true);
PFont font_1;
Table myTable;
int numMonth = 11;
boolean averHighOver = false;
boolean averPrecipOver = false;
boolean Number1 = true;
float angle = 0.03; //rotation value
float Angle = 0.00;
float transX = 0.01; //tranlsate value
float transY = 0.01;
float trans1 = 0.00;
float trans2 = 0.00;
int numRows1 = 0;
int year2 = 2006;
void setup()
{
size(1440,1000);
smooth();
noStroke();
myFont =createFont("Helvetica", 38);
textFont(myFont);
myTable = new Table();
myTable = loadTable( "data06-13-3.csv", "header");
numRows = myTable.getRowCount();
numColumns = myTable.getColumnCount();
dataMatrix = new int[numRows][numColumns];
for (int i = 0; i < numRows; i ++)
{
for ( int j = 0; j < numColumns; j ++)
{
dataMatrix[i][j] = myTable.getInt(i,j);
}
}
maxCount = dataMatrix[0][0];
for (int i = 0; i < numRows; i ++)
{
for ( int j = 1; j < numColumns; j ++)
{
if (dataMatrix[i][j] > maxCount)
maxCount = dataMatrix[i][j];
}
}
//////////////////button and slide/////////////////
cp5 = new ControlP5(this);
translate(width/2,400);{
cp5.addButton("Ave_Temp_High")
.setValue(0)
.setPosition(30,610)
.setSize(200,19)
;
cp5.addButton("Ave_Precip")
.setValue(100)
.setPosition(30,640)
.setSize(200,19)
;
cp5.addButton("Number")
.setPosition(30,670)
.setSize(200,19)
.setValue(0)
;
cp5.addSlider("ANGLE")
.setPosition(30,700)
.setSize(200,20)
.setRange(0,200)
.setValue(0)
;
cp5.addSlider("transX")
.setPosition(30,730)
.setSize(200,20)
.setRange(0,200)
.setValue(0)
;
cp5.addSlider("transY")
.setPosition(30,760)
.setSize(200,20)
.setRange(0,200)
.setValue(0)
;
cp5.addSlider("Month")
.setPosition(30,790)
.setSize(400,20)
.setRange(1,96)
.setValue(1)
;
}
}
//////average high temperature from Jan to Dec in Seattle
float[] aveHigh = {46,50,53,58,64,70,75,76,70,60,51,46};
float maxHigh = max(aveHigh);
float minHigh = min(aveHigh);
int numcolormode1 = 11;
int[] colormode = {
#DBDB8F,#DBC783,#DBB377,#DB9F6B,#DC8C60,#DC7854,#DC6448
,#DC503C,#DD3D31,#DD2925,#DD1519,#DE020E};
//////average precipitation from Jan to Dec in Seattle
float[] avePrecip = {5.13,4.18,3.75,2.59,1.78,1.49,0.79,1.02,1.63,3.19,5.90,5.62};
float maxPrecip = max(avePrecip);
float minPrecip = min(avePrecip);
int[] colormode1 = {
#ADFFFF,#9DE8F2,#8DD2E5,#7DBBD9,#6EA5CC,#5E8EC0,#4E78B3
,#3E61A7,#2F4B9A,#1F348E,#0F1E81,#000875
};
public void controlEvent(ControlEvent theEvent) {
n = 0;
}
public void Ave_Temp_High() {
averHighOver = true;
averPrecipOver = false;
}
public void Ave_Precip() {
averPrecipOver = true;
averHighOver = false;
}
public void Number() {
Number1 = !Number1;
}
void draw()
{
background(232);
pushMatrix();
translate(width/2,400);
for(int q = 0; q < 12; q++){
color x = colormode[q];
fill(x);
rect(-690+q*17,-300,19,19);
color z = colormode1[q];
fill(z);
rect(-690+q*17,-350,19,19);
}
textSize(13);
textAlign(CENTER);
fill(colormode[0]);
text(minHigh,-690,-307);
fill(colormode[11]);
text(maxHigh,-480,-307);
fill(colormode[0]);
textAlign(CENTER);
text("Temperature",-585,-307);
textSize(13);
textAlign(CENTER);
fill(colormode1[0]);
text(minPrecip,-690,-357);
fill(colormode1[11]);
text(maxPrecip,-480,-357);
fill(colormode1[0]);
textAlign(CENTER);
text("Precipitation",-585,-357);
textSize(20);
textAlign(LEFT);
text("Comicbook\nCheckout\n+\nWeather\n2006-\n2013",
-680,-20);
ellipse(-650,-200,41029/ballR,41029/ballR);
fill(0);
textAlign(CENTER,CENTER);
textSize(13);
text("41029",-655,-130);
fill(#4E78B3);
ellipse(-560,-200,20093/ballR,20093/ballR);
fill(0);
textAlign(CENTER,CENTER);
textSize(13);
text("20093",-565,-130);
fill(#000875);
ellipse(-500,-200,2825/ballR,2825/ballR);
fill(0);
textAlign(CENTER,CENTER);
textSize(13);
text("2825",-500,-130);
for(int z = 0; z < 9; z++){
textSize(10);
fill(#FFFFFF);
text(year2+z,-690+z*50,420);
}
pushMatrix();
translate(200,0);
for(int i = 0; i <numRows1; i++)
{
for(int j = 1; j <numColumns; j++)
{
for(int p = 0; p <numMonth; p ++)
{
colorMode(HSB,360,100,100);
if(dataMatrix[i][0] == 1 && averHighOver == true){
float High = map(aveHigh[0],minHigh,maxHigh,0,numcolormode1);
float d = High;
int c = round(d);
color x = colormode[c];
fill(x,33);
}
else if(dataMatrix[i][0] == 2 && averHighOver == true){
float High = map(aveHigh[1],minHigh,maxHigh,0,numcolormode1);
float d = High;
int c = round(d);
color x = colormode[c];
fill(x,33);}
else if(dataMatrix[i][0] == 3 && averHighOver == true){
float High = map(aveHigh[2],minHigh,maxHigh,0,numcolormode1);
float d = High;
int c = round(d);
color x = colormode[c];
fill(x,33);}
else if(dataMatrix[i][0] == 4 && averHighOver == true){
float High = map(aveHigh[3],minHigh,maxHigh,0,numcolormode1);
float d = High;
int c = round(d);
color x = colormode[c];
fill(x,33);}
else if(dataMatrix[i][0] == 5 && averHighOver == true){
float High = map(aveHigh[4],minHigh,maxHigh,0,numcolormode1);
float d = High;
int c = round(d);
color x = colormode[c];
fill(x,33);}
else if(dataMatrix[i][0] == 6 && averHighOver == true){
float High = map(aveHigh[5],minHigh,maxHigh,0,numcolormode1);
float d = High;
int c = round(d);
color x = colormode[c];
fill(x,33);}
else if(dataMatrix[i][0] == 7 && averHighOver == true){
float High = map(aveHigh[6],minHigh,maxHigh,0,numcolormode1);
float d = High;
int c = round(d);
color x = colormode[c];
fill(x,33);}
else if(dataMatrix[i][0] == 8 && averHighOver == true){
float High = map(aveHigh[7],minHigh,maxHigh,0,numcolormode1);
float d = High;
int c = round(d);
color x = colormode[c];
fill(x,33);}
else if(dataMatrix[i][0] == 9 && averHighOver == true){
float High = map(aveHigh[8],minHigh,maxHigh,0,numcolormode1);
float d = High;
int c = round(d);
color x = colormode[c];
fill(x,33);}
else if(dataMatrix[i][0] == 10 && averHighOver == true){
float High = map(aveHigh[9],minHigh,maxHigh,0,numcolormode1);
float d = High;
int c = round(d);
color x = colormode[c];
fill(x,33);}
else if(dataMatrix[i][0] == 11 && averHighOver == true){
float High = map(aveHigh[10],minHigh,maxHigh,0,numcolormode1);
float d = High;
int c = round(d);
color x = colormode[c];
fill(x,33);}
else if(dataMatrix[i][0] == 12 && averHighOver == true){
float High = map(aveHigh[11],minHigh,maxHigh,0,numcolormode1);
float d = High;
int c = round(d);
color x = colormode[c];
fill(x,33);}
else if(dataMatrix[i][0] == 1 && averPrecipOver == true){
float High = map(avePrecip[0],minPrecip,maxPrecip,0,numcolormode1);
float d = High;
int c = round(d);
color x = colormode1[c];
fill(x,33);}
else if(dataMatrix[i][0] == 2 && averPrecipOver == true){
float High = map(avePrecip[1],minPrecip,maxPrecip,0,numcolormode1);
float d = High;
int c = round(d);
color x = colormode1[c];
fill(x,33);}
else if(dataMatrix[i][0] == 3 && averPrecipOver == true){
float High = map(avePrecip[2],minPrecip,maxPrecip,0,numcolormode1);
float d = High;
int c = round(d);
color x = colormode1[c];
fill(x,33);}
else if(dataMatrix[i][0] == 4 && averPrecipOver == true){
float High = map(avePrecip[3],minPrecip,maxPrecip,0,numcolormode1);
float d = High;
int c = round(d);
color x = colormode1[c];
fill(x,33);}
else if(dataMatrix[i][0] == 5 && averPrecipOver == true){
float High = map(avePrecip[4],minPrecip,maxPrecip,0,numcolormode1);
float d = High;
int c = round(d);
color x = colormode1[c];
fill(x,33);}
else if(dataMatrix[i][0] == 6 && averPrecipOver == true){
float High = map(avePrecip[5],minPrecip,maxPrecip,0,numcolormode1);
float d = High;
int c = round(d);
color x = colormode1[c];
fill(x,33);}
else if(dataMatrix[i][0] == 7 && averPrecipOver == true){
float High = map(avePrecip[6],minPrecip,maxPrecip,0,numcolormode1);
float d = High;
int c = round(d);
color x = colormode1[c];
fill(x,33);}
else if(dataMatrix[i][0] == 8 && averPrecipOver == true){
float High = map(avePrecip[7],minPrecip,maxPrecip,0,numcolormode1);
float d = High;
int c = round(d);
color x = colormode1[c];
fill(x,33);}
else if(dataMatrix[i][0] == 9 && averPrecipOver == true){
float High = map(avePrecip[8],minPrecip,maxPrecip,0,numcolormode1);
float d = High;
int c = round(d);
color x = colormode1[c];
fill(x,33);}
else if(dataMatrix[i][0] == 10 && averPrecipOver == true){
float High = map(avePrecip[9],minPrecip,maxPrecip,0,numcolormode1);
float d = High;
int c = round(d);
color x = colormode1[c];
fill(x,33);}
else if(dataMatrix[i][0] == 11 && averPrecipOver == true){
float High = map(avePrecip[10],minPrecip,maxPrecip,0,numcolormode1);
float d = High;
int c = round(d);
color x = colormode1[c];
fill(x,33);}
else if(dataMatrix[i][0] == 12 && averPrecipOver == true){
float High = map(avePrecip[11],minPrecip,maxPrecip,0,numcolormode1);
float d = High;
int c = round(d);
color x = colormode1[c];
fill(x,33);}
line(0,0,dataMatrix[i][j],dataMatrix[i][j]);
ellipse(dataMatrix[i][j]/140+100,dataMatrix[i][j]/800,dataMatrix[i][j]/ballR,dataMatrix[i][j]/ballR);
}
translate(transX*trans1,transY*trans2);
rotate(angle*Angle);
if(Number1 == true){
textSize(14);
textAlign(CENTER);
fill(88);
text(dataMatrix[i][j],dataMatrix[i][j]/140+100,dataMatrix[i][j]/800);
}
}
}
popMatrix();
popMatrix();
save("hw3-8.jpg");
}
void ANGLE(float theColor) {
Angle = theColor/200;
}
void transX(float theColor) {
trans1 = theColor*2;
}
void transY(float theColor) {
trans2 = theColor*1;
}
void Month(int theColor){
numRows1 = theColor;
}