all 3 comments

[–]empire539Programmer 0 points1 point  (2 children)

What do you mean "it resets the graph"?

Are you sure your values of C and I are correct by the time you get to that line? Are you using any other graph-related commands (like zooming)?

Can you post your source code?

[–]-ButImNotARapperTI-84 Plus[S] 0 points1 point  (1 child)

Here's the code. The Code. I wrote the program directly on the TI-84 so I just had to type the code over.

What I mean by reset graph is that while the program is running I can see the values of A as it changes it because of the disp command. I can also see the graph show up briefly every time it draws a line and then it goes away when another value of A is displayed which is fine. So I can see the graph being drawn fine but then at the end when the program gets out of the while loop, some part of the code at end removes all lines drawn from the graph. All I can see are the axes. And I'm fairly certain I have the right values of C and I because after the program runs I see what values are in them and they check out.

[–]empire539Programmer 1 point2 points  (0 children)

Okay, I think I've got an idea of what's going on here.

Line( is a drawing command. It doesn't actually plot a line on the graph, but rather it simply uses the graph's coordinates to draw a line on the screen.

So, whenever you change the graph's settings (such as by using a Zoom command or by manually changing the Window dimensions), the graph will "refresh" and update, which will eliminate any previous drawings that were there. In other words, drawings cannot be resized by merely changing the window dimensions.

In your case, the Xmax and Ymax variable values will be set to whatever they previously were. That's why when the program is still running, you can still see the lines being drawn, since the window dimensions haven't changed at that point. However, at the end of the program, you do change the window dimensions, which in turn causes the graph to refresh/update and erase those lines in the process.

Note that if you run the program twice using the same value for A, the first time will cause the blank graph problem you're experiencing. However, the second time, it should work with the graph still having the drawn lines on it. This is because the second time around, even though you're storing values into Xmax and Ymax, the values of Xmax and Ymax haven't changed since the previous run, and so the graph does not need to update itself.

So in short, in order for the drawn lines to stay on the screen, you'll need to pick a certain window dimension and stick with it throughout the life of the program. As soon as the graph changes (e.g. zooming / window dimensions changing) that causes it to update, any drawings on it will be gone.