Simulation time display in animation is unreadable because it moves from frame to frame

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Simulation time display in animation is unreadable because it moves from frame to frame

mgriffith
Hello,

Here is a video I made with postanimate()
 SliceNOHM0p5mmDesign.mp4
If you notice the title is unreadable because the number of digits displayed for the time changes and the title is centered so it kind of vibrates back and forth making the whole thing unreadable. Is there any way for me to change how the simulation time is displayed?

As always thanks for the help,

Matt
Reply | Threaded
Open this post in threaded view
|

Re: Simulation time display in animation is unreadable because it moves from frame to frame

Precise Simulation
Administrator
This post was updated on .
Thank you for trying out the animation feature and pointing out this issue. I will make a fix for the next update. In the meantime an "ugly" workaround is to override the Matlab built-in "num2str" function. That is to make a file named "num2str.m" with the contents:

  function [ str ] = num2str( num )
  str = sprintf( '%5.1f', num );

When this function can be found my Matlab it will be used instead of the built-in, and print the number with one decimal. As, overloading the built-ins could potentially conflict with normal operation it is probably advisable to only use it when you for example want to use "postanimate", and then maybe rename it to for example "num2str_1.m" when not in use.

mgriffith wrote
Here is a video I made with postanimate()
 SliceNOHM0p5mmDesign.mp4
If you notice the title is unreadable because the number of digits displayed for the time changes and the title is centered so it kind of vibrates back and forth making the whole thing unreadable. Is there any way for me to change how the simulation time is displayed?
Reply | Threaded
Open this post in threaded view
|

Re: Simulation time display in animation is unreadable because it moves from frame to frame

mgriffith
Thanks for the suggestion. That is super hacky, but it worked.