# Wont display my second set of numbers

**URL:** https://discourse.processing.org/t/wont-display-my-second-set-of-numbers/2371
**Category:** Coding Questions
**Created:** [August 4, 2018, 9:46pm UTC](https://discourse.processing.org/t/wont-display-my-second-set-of-numbers/2371 "2018-08-04T21:46:11Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![magic\_moose](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/magic_moose/32/1001_2.png) [@magic\_moose](https://discourse.processing.org/u/magic_moose)
#### Post date: [August 4, 2018, 9:46pm UTC](https://discourse.processing.org/t/wont-display-my-second-set-of-numbers/2371/1 "2018-08-04T21:46:11Z")

</div>

I am trying to use a TSV data file to plot on a graph however the second collum of data isnt being recognized. Can someone Help?

Here is my Code so far:

PFont font;

float x1, y1, x2, y2;

int[]fireData;  
int[]years;

int mostFires;  
int leastFires;

void setup(){  
size(500,500);  
font = loadFont(“berlin30.vlw”);  
textFont(font);  
x1 = 40;  
y1 = 90;  
x2 = width- x1;  
y2 = height - y1;

smooth();

//read the data table  
String[] data = loadStrings(“Califires.tsv”);

fireData = new int [data.length];  
years = new int [data.length];

for(int i=0; i\<data.length; i++){  
String[] pieces = split(data[i], “,”);

years[i] = int(pieces[0]);  
fireData[i] = int(pieces[1]);  
}  
println(“How many years: “+years.length+””);  
println(fireData);

mostFires = max(fireData);  
leastFires = min(fireData);  
}

void draw(){  
background(11, 224, 144);

rectMode(CORNERS);  
noStroke();  
fill(255, 237, 223);  
rect(x1, y1, x2, y2);

fill(8, 4, 4);  
text(“Fires in California through the years”, x1, y1-20);

drawGraph(fireData, mostFires, leastFires, #FF1E06, “F”);

}

void drawGraph(int[] data, int yMin, int yMax, color sColor, String label){  
float x=0;  
float y=0;

stroke(sColor);  
strokeWeight(2);

beginShape();  
for(int i=0; i\<data.length; i++){  
x = map(i,0, data.length-1, x1, x2);  
y = map(data[i], yMin, yMax, y2, y1);  
vertex(x,y);  
}  
endShape();

if(sColor == color(#000000)){  
sColor = color(#EEEEEE);  
}  
fill(sColor);  
textAlign(LEFT);  
text(label, x+10, y);  
noFill();  
}

When I run the println it only show’s 0 for the data which should be large numbers.

Here is the tsv file:

 ![Capture](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/f/f31d21c74f899750d2084f4a36a7caaeacc781d6.PNG)

---

<div class="post-metadata">

### Author: ![behreajj](https://avatars.discourse-cdn.com/v4/letter/b/b5a626/32.png) [@behreajj](https://discourse.processing.org/u/behreajj)
#### Post date: [August 4, 2018, 10:02pm UTC](https://discourse.processing.org/t/wont-display-my-second-set-of-numbers/2371/2 "2018-08-04T22:02:49Z")

</div>

Hi magic\_moose,

A .csv file separates columns by commas. A .tsv file separates columns by tabs. Your file separates columns by both. Does splitting `data[i]` by `",\t"` instead of `","` change the result?

Best,

---

<div class="post-metadata">

### Author: ![magic\_moose](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/magic_moose/32/1001_2.png) [@magic\_moose](https://discourse.processing.org/u/magic_moose)
#### Post date: [August 4, 2018, 10:12pm UTC](https://discourse.processing.org/t/wont-display-my-second-set-of-numbers/2371/3 "2018-08-04T22:12:50Z")

</div>

![graph](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/0/0c242e5b0da2a7f5cc4141c98ad43b1ed011639f.PNG)

Another question I had was do you know how to get rid of the black between my graph line?

---

<div class="post-metadata">

### Author: ![kfrajer](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kfrajer/32/196_2.png) [@kfrajer](https://discourse.processing.org/u/kfrajer)
#### Post date: [August 5, 2018, 6:49am UTC](https://discourse.processing.org/t/wont-display-my-second-set-of-numbers/2371/4 "2018-08-05T06:49:02Z")

</div>

> [@behreajj](#):
>
> Your file separates columns by both.

Another options is to use replace:

> [String / Reference / Processing.org](https://processing.org/reference/String.html)  
> [String (Java Platform SE 6)](https://docs.oracle.com/javase/6/docs/api/java/lang/String.html#replaceAll(java.lang.String,%20java.lang.String))

I believe `splitTokens` could do the job as well.

For the second question, to remove the black color under the curve, you need to call `noFill();` at the beginning of: `drawGraph()`

Kf
