3

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

Jason B.
  • 68,381
  • 3
  • 139
  • 286
SKMohammadi
  • 153
  • 5
  • This is closely related to http://mathematica.stackexchange.com/questions/109982/how-to-make-the-digits-of-%CF%80-go-around-in-a-spiral-like-this – e.doroskevic Mar 15 '16 at 10:39
  • 1
    What that image has to do with the question? If that's the goal, take a look at ListPolarPlot. – Kuba Mar 15 '16 at 10:46

1 Answers1

6

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

Jason B.
  • 68,381
  • 3
  • 139
  • 286