Make a graph plz help

hm not entirely sure what you’re doing with your code, especially the for loops in setup().

  for (float xx=75; xx<=stopX; xx+=space)       // x-as
  {   
    line(xx, y, xx, y+len1);
  }
 
  for (float yy=125; yy<=stopY; yy+=space)     //y-as
  {  
    line(x, yy, x+len2, yy);
  }

those for loops will never loop because the starting value of xx (75) and yy (125) are already larger than what you gave stopX and stopY.

float stopX = 5.960296;                      // Maximum x-as
float stopY = 50.882125;                      // Maximum Y-as

Also i’m not quite sure about what stopX and stopY are in the first place? if you want to make a raster of lines like the graph you described, the “maximum x-as” and “maximum Y-as” should both go to 1000 right?
you can create this graph with just a nested for-loop:

fill(0);
textSize(10);
for (float xx=25; xx<=1025-space; xx+=space) {     // x-as   
    for (float yy=25; yy<=1025-space; yy+=space) {   // y-as

      line(xx, yy, xx, yy+space);
      line(xx, yy, xx+space, yy);
      if(xx == 25)  text((int)(yy-space),xx-space,yy);
      else if(yy==25) text((int)(xx-space),xx,yy);
    }
    line(25,1025, 1025,1025);
    line(1025,25,1025,1025);
  }

this will create a “graph” in which you can now represent your data.
also note that the Y-axis is top-to-bottom, instead of what is usual with graphs.

This is the total code I made, hopefully something more like you wanted:

import processing.serial.*;

Serial myPort; // maakt een object van seriele poort
String val; //ontvangt de data van de seriele poort

float x=0, y=0;
float space = 25;                            //grootte hokjes


void setup ()
{
  size (1050, 1050); // maak het canvas
  background(255);
  String portName = Serial.list() [0];         // de 0 moet worden veranderd in de poort
  myPort= new Serial(this, portName, 9600);


  //float y =0; 
  //float x=0;
  //float len1 = 400;                          // aantal hokjes y- as (breedte veld/grootte hokjes)
  //float stopX = 5.960296;                    // Maximum x-as
  //float len2 = stopX-x;                      // aantal hokjes x-as
  //float stopY = 50.882125;                   // Maximum Y-as
}

void draw () {
background(255);

  fill(0);
  textSize(10);
  for (float xx=25; xx<=1025-space; xx+=space) {     // x-as   
    for (float yy=25; yy<=1025-space; yy+=space) {   // y-as

      line(xx, yy, xx, yy+space);
      line(xx, yy, xx+space, yy);
      if (xx == 25)  text((int)(yy-space), xx-space, yy);
      else if (yy==25) text((int)(xx-space), xx, yy);
    }
    line(25, 1025, 1025, 1025);
    line(1025, 25, 1025, 1025);
  }


  if (myPort.available() > 0) //als data beschikbaar is
  {
    val = myPort.readStringUntil('\n'); // lees het uit en sla het op in val

    if (val != null)      // Als er waardes worden uitgelezen gaat de hier in
    {
      float [] list = float( split (val, ","));   // data verkregen van arduino wordt bij de komma gesplitsd.
      println(val); // print het uit op het console

      x = list[0];               //part1 wordt de de eerst afkoppeling opgeslagen
      y = list[1];               // part2 wordt de tweede afkoppeling opgeslagen

      //float X1= part1;                              // part1 wordt opgeslagen als X
      //float Y1= part2;                               // part2 wordt opgeslagen als Y
      //were just an extra step that's not neccessary
    }
  }



  //fill(205, 61, 62);            //Rood vierkant gemaakt
  //rect(100, 250, 800, 500);     //for what?

  //fill(150, 255, 0);
  //rect(125,275,750,450);        // groen vierkant wordt gemaakt 


  fill(0); 
  textSize(40); 
  text("GPS Tracker", 350, 220);     //Tekst wordt geschreven
  fill(0, 0, 255); 

  point (x, y);                        // de variabelen uit part1 en part2 worden gebruikt voor de coördinaten
}