I want to plot multiple disks with disk-coordinates and disk-radii from two dynamically updated lists. I think there should be an easy way to do that but I dont get it. Thx for your help!

Slider[Dynamic[x], {0, 100, 1}] 
List1 = Dynamic[RandomInteger[40, {x, 2}]](*disk coordinates*)
List2 = Dynamic[RandomInteger[4, x]] (*disk radii*)
Dynamic[Graphics[Table[{Disk[List1, List2]}, {x}]]] (*doesnt work*)
Dynamic[Graphics[MapThread[Disk[#1, #2] &, {List1, List2}]]] (*doesnt work*)

1 Answer 1

 coords = RandomInteger[{5, 95}, {x, 2}];
 radii = RandomInteger[{1, 4}, x];
  Graphics[Table[Disk[coords[[n]], radii[[n]]], {n, 1, Length[coords]}]],
  PlotRange -> {{0, 100}, {0, 100}}
  ], {x, 1, 100, 1}]

enter image description here


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.