2
$\begingroup$

This code gives me two sets of concentric circles with respective radii of 2n and 2n-1:

With[{n = 5}, Show[Graphics[
({{Circle[{0, 0}, 2*#1]}, {Circle[{0, 0}, 
     2*#1 - 1]}} & ) /@ Range[n]], Axes -> True]]

enter image description here

I would like alternating circles to be red and blue. I don't want to change anything else. But I can't figure out where to insert a PlotStyle instruction...

Any suggestions?

$\endgroup$
3
$\begingroup$
With[{n = 5}, Graphics[{{Red, Circle[{0, 0}, 2*#1]}, Blue, {Circle[{0, 0}, 2*#1 - 1]}} &/@
  Range[n], Axes -> True]]

enter image description here

$\endgroup$
  • $\begingroup$ Appreciated. Feeling a bit of muppet. Can't accept for 8 mins, but will then do so :-) $\endgroup$ – Richard Burke-Ward Oct 25 '18 at 23:23
  • 1
    $\begingroup$ @RichardBurke-Ward, it happens to all of us:) $\endgroup$ – kglr Oct 25 '18 at 23:24

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.