3
$\begingroup$

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

$\endgroup$
6
$\begingroup$

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},
 ListPolarPlot[
  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

$\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.