so basically i want to get rid of the left side of the graph or maybe move the axis lines over and if possible put numbers on the x and y axis like in the other picture
Given you were able to write the code above, I would have thought you'd find it easy enough to move the axis. You just need to tweak one of the conditions. (Line 67 looks like one place you need to change?)
And you should be able to use a simlar approach to decide whether to write a label rather than draw the graph. It would involve resizing and moving the graph a bit.
It might help to get a piece of old-fashioned graph paper and plan it out.
Andy
P.S. the plot() function is misnamed. It doesn't plot anything. In fact, it's just another name for sine in this case. Line 51-75 looks like a candidate for a function with that name.
ok thanks the graph isnt copying onto this properly but i moved the line over and now i want to get rid of the wave on the left side of the line. and is there a simple way to just put numbers along the axis lines?
Getting rid of the left hand side shold just be a case of starting to plot from e.g. x = 5 rather than 0. The you can use 0-4 for your label, with the same kind of logic. You want a label for the y axiz on rows 1, 12, 24 -- or whatever. when you start the row, format the number as a string (sprintf of ltoa) and then use the chars in the string rather than " ", "o", ...
for(int y=1;y<=24;y++)
{
for(int d=0;d<=4;d++)
{
// draw label
}
for(int d=5;d<=4;d++)
{
if (y == 12)
{
// draw axis, as above
}
elseif (y >= 13 && y <= 15)
{
// draw label or line
}
else
{
// etc
}
}
}
Or you could create an array of strings for the labels: most would be empty. This might be easier if you want to label the x axis. Unless you just want 3 labels, which will prob be easier to special case.
ok the graph didnt copy over right so the real graph doesnt look this bad
but i got the lines on top of the x axis to move over and i cant get the lines at the bottom to move over. any number in the for loops i change just causes the graph to change completely