I want to plot first 100 Prime numbers in circular format (on circular orbit) in Mathematica.

How can i do this?

enter image description here


1 Answer 1


It took a bit of work to get the plot going in the clockwise direction, and to get the origin of the polar plot on the top rather than on the right, but this should do the trick,

With[{nprimes = 50},
  Table[{Mod[π/2 - n 4 π/nprimes, 2 π], Prime[n]}, {n, 
    nprimes}], PolarAxes -> True, 
  PolarTicks -> {Table[{n π/180, Mod[90 - n, 360]}, {n, 0, 360, 
      45}], Automatic},
  PolarGridLines -> Automatic,
  Joined -> True,
  Mesh -> Full,
  MeshStyle -> Directive[PointSize[Large], Red],
  PlotStyle -> Black, PlotRange -> 1.2 Prime[nprimes]]

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.