I have two classes which create two different types of graphs, and have written a method for each which labels the axes. This is for an interactive visualization and the contents of the graphs change with the press of a button, so each object I create from my class needs to have different labels on the axis. Right now everything is showing up in the right place, except that the labels are showing up oddly, as though the loop is creating each one multiple times and then adding some extra digits for the hell of it.
I have some experience with Java, but am by no means an expert, and my code is a bit convoluted. I've included the code for my method, as well as a screenshot so you can see what I mean about the overlapping labels. The variable ypos is an int and 'normalizes' the labels so that they line up with the bars or lines in the graph. The variable barbottom is a float and represents the lower y-bound of the bar graph.
In the picture, the markers on the x-axis are unchanging. It's the y-axis I'm having trouble with; in this case, the numbers in the array called by the method are {2,4,6,8,10,12,14,16}. I have no idea where all the zeroes are coming from.
Any help would be appreciated; I have until Monday to get it working!
String label;
float[] markers;
// causing labels to overlap something awful... don't know why