Message Boards Message Boards

[GIF] Vitals (Animated von Mises distribution)

Animated von Mises distribution

Vitals

This one is pretty simple: there are 22 rows of dots, translating left or right depending on whether the row number is even or odd. Within each row, you can see the dots as plotting the density of the von Mises distribution. Specifically, the radius of each dot is the value of the von Mises pdf at that point.

Note that the von Mises distribution is like a Gaussian distribution on the circle. In particular, it is a periodic probability distribution, which is why each row is periodic, showing a total of 5 periods.

Here's the code:

Manipulate[
 Show[
  GraphicsGrid[
   Table[{
     Graphics[
      {Lighter[ColorData["Rainbow"][1 - (n + 10)/21], .2],
       Disk[{#, 0}, PDF[VonMisesDistribution[0, .3], Mod[# + (-1)^n t, 2 π, -π]]] & /@ 
        Range[-4 π, 4 π, π/6]},
      PlotRange -> {{-4 π - π/12, 4 π + π/12}, {-.5, .5}}]},
     {n, -10, 11}],
   Spacings -> {-6, Automatic}],
  ImageSize -> 600, Background -> GrayLevel[.1], PlotRangePadding -> {None, Scaled[.0242]}
  ],
 {t, 0, 2 π}]
4 Replies
Posted 4 years ago

That was a quick fix! I really enjoy your work, and I love playing with the code, so thanks for making it available!

POSTED BY: Elijah Fromm
Posted 4 years ago

Very cool gif! I got it to work by replacing the ? with π in the code. Also, I think it's 4 periods in each row, rather than 5.

POSTED BY: Elijah Fromm

Thanks! I just fixed the code (which was corrupted by a Wolfram Community bug), and of course you're quite right that it is 4 periods, not 5.

enter image description here - Congratulations! This post is now a Staff Pick as distinguished by a badge on your profile! Thank you, keep it coming!

POSTED BY: EDITORIAL BOARD
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract