Quantcast
Channel: Library Questions - Processing 2.x and 3.x Forum
Viewing all articles
Browse latest Browse all 2896

grafica replacing axis ticks with new strings

$
0
0

Is there a way to change to replace the label ticks for the x/y axis with a string instead of the associated number? For example let's look at this code:

import grafica.*;

GPlot plot;

GPointsArray myArray = new GPointsArray(0);

void setup() {
  size(500, 500);

  plot = new GPlot(this, 0, 0, 500, 500);

  myArray.add(0, 0);
  myArray.add(1, 1);
  myArray.add(2, 2);
  myArray.add(3, 3);
  myArray.add(4, 4);
  myArray.add(5, 5);

  plot.setPoints(myArray);
  plot.defaultDraw();
}

It creates this graph:

line

I need it to appear like this by replacing each tick with a new string:

line3


Viewing all articles
Browse latest Browse all 2896

Trending Articles