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')
==============
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
Release history Release notifications | RSS feed
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.4.tar.gz
(6.2 kB
view hashes)