1
$\begingroup$

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*)
$\endgroup$
3
$\begingroup$
Manipulate[
 coords = RandomInteger[{5, 95}, {x, 2}];
 radii = RandomInteger[{1, 4}, x];
 Show[
  Graphics[Table[Disk[coords[[n]], radii[[n]]], {n, 1, Length[coords]}]],
  PlotRange -> {{0, 100}, {0, 100}}
  ], {x, 1, 100, 1}]

enter image description here

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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