Skip to main content

Animation of matplotlib images

Project description


==============
Animate Images
==============

Helper functions to make animations of images with corresponding traces and labels using matplotlib

------------
Example use:
------------
.. code-block:: python
from Animate import Animation

prepare = Prepare('a', 'b', None)
data = np.random.rand(10, 40, 20)
prepare.add_image(data, c_title='try1')
data = np.random.rand(10, 40, 20)
prepare.add_image(data, c_title='try2')
prepare.add_scale_bar(pixel_width=4)
prepare.add_scale_bar(pixel_width=8, axis=1)
prepare.add_time_label()
prepare.add_annotation(0, (3, 3), (7, 9), '123', size=13, ha='right', va='center',
arrowprops=dict(arrowstyle="->", color='b'), color='g')
prepare.add_circle_annotation(1, 3, 7, 3, color='b', lw=0.5, fill=False)
prepare.add_axis('Time (s)', '$\Delta$F/F')
prepare.add_trace(np.random.rand(10), 0, 'try1')
prepare.add_trace(np.random.rand(10) + 2, 0, 'try2')
prepare.add_axis('Time (s)', '$\Delta$F/F')
prepare.add_trace(np.random.rand(10), 1, 'try1')
prepare.add_trace(np.random.rand(10) + 2, 1, 'try2')
animation = Animation(prepare)
animation.save('test_sub.mp4', codec='h264')

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

animateimages-0.1.7.tar.gz (6.2 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page