+ 3
P5.js not drawing all circles
I am trying to visualise a nearest neighbour classifier and for this i want to draw multiple circles but for some reason, i can only draw one. At first i tried it with a for loop which also gave the same result. https://code.sololearn.com/Wam840b1HIZt/?ref=app
3 Antworten
+ 6
Julian There are more circles, but the canvas is too small. You have to set the width and height of the canvas with createCanvas(innerWidth, innerHeight) and the rest of the circles will be visible too. 🌹🌹
Edit: at least the 2 green circles appear. I dont see any red circles, so either you have another error in your code, or they are still outside the scope of the screen... 🤔
+ 2
the red circles have negative coordinates. No size of canvas will display that, so they’d better have positive coords if you want them displayed
+ 1