If you just want to draw to the screen, you just need to call the drawing functions, you don't need to store that in arrays. It automatically draws, it's not pilling up.
That's why you don't need global arrays/variable (a variable declared outside of that for block), just local (a variable declared inside that block). That's called scope.
You can read more introductory/general topics in the ofBook or the Processing Handbook. The reason this books are great for a beginner, instead of the common books/web resources, is that they always give you a visual feedback on how stuff works.
Regarding your code, you just need something like so in the draw function:
ofSetColor(abs(mouseX-300),abs(mouseX-300),abs(mouseY-300));
ofRect(0,0,600,600);
for (int i = 0; i < 20 ; ++i) {
for (int j = 0; j < 100 ; ++j) {
int ax1 = 5 + j * 30;
/* This is where it matters.
You can use a bit of math to simplify your code, like so: */
int ay1 = 5 + i * 30;
/* In the first time you go around this second loop you have 5, then 35, then 65, then 95 and so on.
And it's easier to draw more. */
int ax2 = (abs(mouseX)/30 - j);
ofSetColor(abs(mouseX-300),abs(mouseY - 300),180);
ofSetLineWidth(2);
ofCircle(ax1,ay1,ax2);
}
}
I don't know what your curserx and cursery are. But if they are the cursor coordinates, you have two built-in variables mouseX and mouseY.
The reason why you where only getting one line was this one:
ay1[j] = 5+ax0[5 + i * 30];
I thought you where accessing something in the array ax0. But apparently not.
For example, in Java, if you don't assign something to an int, you get 0 (zero). In c++, you may get any value, something related to memory of that variable.