Message Boards Message Boards

Avoid graphics-jitter when Animating Plot?

Anonymous User
Anonymous User
Posted 7 years ago

On my system, this produces a result where the vertical-axis labels jitter left and right by several pixels as the animation progresses:

Module[{tableOfExamples = 
   Table[Plot[E^(-Pi x^2), {x, -Pi, +Pi}, 
     PlotRange -> {Full, {-1.2, +1.2}}, ImageSize -> 270], 32]}, 
 Animate[tableOfExamples[[k]], {k, 1, Length[tableOfExamples], 1}]]

All 32 plots in the animated table are identical, so there's no difference among them to account for the jitter.

I see the jitter when I have magnification for the notebook set to 125% (setting in the lower-right corner of the notebook). When I change the magnification to 100% or 150%, I don't see any jitter.

I'm on Windows 10, and my screen resolution is 1920 x 1080.

enter image description here

The jitter on my screen is faster, but my screen-capture software under-sampled it.

POSTED BY: Anonymous User
6 Replies

With Mathematica 11.1 and Windows 7 I don't see any jitter at any magnification. Nor with extremely fast or slow animation rates.

I see no jitter in any version on a Mac, regardless of magnification. But the front end is known to have some annoying pixel rounding issues, so I am not surprised.

Some tips:

  • Set an explicit numerical PlotRange (not Full or Automatic), and see if it fixes the issue.
  • Look up ListAnimate
  • The jitter would be an issue if you export the animation to show to others. Is it still there in that case?
POSTED BY: Szabolcs Horvát

The site is flaky. Sometimes it takes time until posts appear.

POSTED BY: Szabolcs Horvát
Anonymous User
Anonymous User
Posted 7 years ago

Thank you.

POSTED BY: Anonymous User
Anonymous User
Anonymous User
Posted 7 years ago

I see no jitter in any version on a Mac, regardless of magnification. But the front end is known to have some annoying pixel rounding issues, so I am not surprised.

Thanks.

Look up ListAnimate

Thanks, that's better than what I was doing, but still causes jitter here.

The jitter would be an issue if you export the animation to show to others. Is it still there in that case?

No jitter when I export the Table of Plots to an AVI file. These plots are just for me to look at on my screen though. The jitter isn't a huge deal, but it's still disturbing, and there doesn't seem to be any good reason why it's occurring.

Set an explicit numerical PlotRange (not Full or Automatic), and see if it fixes the issue.

That seems to have fixed it. (I still see jitter, but I think it's imaginary jitter due to my head getting messed up from staring at real jitter for the past day. When I concentrate hard, though, it looks like there's no real jitter now.)

So this is how I changed it:

Module[{tableOfExamples = 
   Table[Plot[E^(-Pi x^2), {x, -Pi, +Pi}, 
     PlotRange -> {{-Pi, +Pi}, {-1.2, +1.2}}, ImageSize -> 270], 32]},
  Animate[tableOfExamples[[k]], {k, 1, Length[tableOfExamples], 1}]]

or better yet, with ListAnimate.

Grateful for the solution, but now concerned by Mathematica's non-constant treatment of Pi. (Is there jitter in some other expressions involving an approximated numerical value of Pi?) And why is PlotRange -> {Full, {-1.2, +1.2} yielding sub-optimal results?

POSTED BY: Anonymous User
Anonymous User
Anonymous User
Posted 7 years ago

Now I'm getting the jitter even when using explicit numerical PlotRange. So explicit numerical PlotRange wasn't actually a solution. We have the technology to do this without jitter, if that's an interesting idea to Wolfram staff.

POSTED BY: Anonymous User
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