I have a DensityPlot which is evaluated for a long time. I wish to use it with animation, but it is absolutely inapropriate.
Is it possible to render animation first and then run it smoothly?
|
I have a Is it possible to render animation first and then run it smoothly? |
||||
|
|
|
Here is an example of how to create an animation from DensitPlot results. I have chosen a simple Gaussian function to plot, but its center depends on a parameter Note on speed To save time, you should execute the following commands in separate cells, and only choose the export or display method that you need. Otherwise the evaluation will probably stretch your patience.
What I did above is to first rasterize the individual frames before making the Update: thanks to Alexey Popkov for reminding me that Working with If you want the movie in Flash format, do this:
In the Flash file, rasterization leads to a smaller file size but the export takes longer for this format. Edit Thanks to @halirutan for pointing out that
Update In Mathematica version 9, though, I see no speed difference with our without the
That's why I also included some Finally, depending on your operating system, it may in fact be best to create the movie in an external application. In that case, you can do the following:
This will create all the frames as individual files numbered movie001.png, movie002.png, etc. These can subsequently assembled in a movie editor. If you want to go that route, that's a different topic that I have discussed some more on the following page: Mathematica image sequence export |
||||
|
|
|
Although the best answer is already accepted, I think something really important was not pointed out here. It's the existence of an Therefore, when someone wants to convert a list of graphics into a rasterized format for fast rendering, the usage of Please try it yourself with a list of 50
And now compare the speed of calls to
This takes about 50 seconds here on my MacBook. Now, use "Image" to tell
This takes only 5 seconds on the same machine. Even the rendering seems to run more fluent from the beginning, where with the first version it seems to take some loops before the Note that even the export of a list of |
|||||||||||||||
|
|
You can also Export as video, see this documentation. |
|||||||||||||
|
|
Yes, you can create a table of the plots at appropriate time intervals and then use |
|||||
|