postmd.animate package
- class postmd.animate.AppendAnimate(*args, fps=20, dpi=72, range_mode='auto')[source]
Bases:
BaseAnimateanimate data by appending data to the figure.
- Parameters:
*args – a set of y data
(ydata1, ydata2, ...), orx, (ydata1, ydata2, ...). Each ydata should be a 1D array.fps (int, optional) – Frames per second (FPS) setting for animation. Defaults to
20.dpi (int, optional) – Dots per inch (DPI) resolution for animation. Defaults to
72.range_mode (str, optional) – Determines the behavior of x and y limits in the animation. Defaults to
'auto'. - If set to'auto', the x and y limits will automatically adjust to the data range. - If set to'fix', the x and y limits will be fixed to a specific range. The fixed range is from the min to max of data plus 5% margin.
- save(filename, output_format=None)[source]
save the animation of data to file.
- Parameters:
filename (str) – file name to output
output_format (str, optional) – the output format. Now only support
gif,mp4, andavi. Defaults toNone, meaning the output format is inferred from the filename extension.
- class postmd.animate.CumAnimate(*args, fps: int = 20, dpi: int = 72, range_mode: str = 'auto', mode: str = 'mean')[source]
Bases:
BaseAnimateThe cumulative animation of a set of data, which is usually for show the change of data with number of experiments or cumulative average.
- Parameters:
*args – a set of y data
(ydata1, ydata2, ...), orx, (ydata1, ydata2, ...). Each ydata should be a 1D array.fps (int, optional) – Frames per second (FPS) setting for animation. Defaults to
20.dpi (int, optional) – Dots per inch (DPI) resolution for animation. Defaults to
72.range_mode (str, optional) – Determines the behavior of x and y limits in the animation. Defaults to
'auto'. - If set to'auto', the x and y limits will automatically adjust to the data range. - If set to'fix', the x and y limits will be fixed to a specific range. The fixed range is from the min to max of data plus 5% margin.mode (str, optional) –
"mean","sum"or"mean". Defaults to None. - Ifmode="mean", the cumulative average of(ydata1, ydata2, ...)will display in order as animation. The n-th frame is(ydata1+ydata2+...+ydatan)/n- Ifmode="sum", the cumulative summation of(ydata1, ydata2, ...)will display in order as animation. The n-th frame isydata1+ydata2+...+ydatan- Ifmode="sequence",ydata1,ydata2, … will display in sequence as animation
- save(filename, output_format=None)[source]
save the animation of data to file.
- Parameters:
filename (str) – file name to output
output_format (str, optional) – the output format. Now only support
gif,mp4, andavi. Defaults toNone, meaning the output format is inferred from the filename extension.
Submodules
postmd.animate.animate module
- class postmd.animate.animate.BaseAnimate(*args, fps=20, dpi=72)[source]
Bases:
object- save(filename, output_format=None)[source]
save the animation of data to file.
- Parameters:
filename (str) – file name to output
output_format (str, optional) – the output format. Now only support
gif,mp4, andavi. Defaults toNone, meaning the output format is inferred from the filename extension.
- class postmd.animate.animate.AppendAnimate(*args, fps=20, dpi=72, range_mode='auto')[source]
Bases:
BaseAnimateanimate data by appending data to the figure.
- Parameters:
*args – a set of y data
(ydata1, ydata2, ...), orx, (ydata1, ydata2, ...). Each ydata should be a 1D array.fps (int, optional) – Frames per second (FPS) setting for animation. Defaults to
20.dpi (int, optional) – Dots per inch (DPI) resolution for animation. Defaults to
72.range_mode (str, optional) – Determines the behavior of x and y limits in the animation. Defaults to
'auto'. - If set to'auto', the x and y limits will automatically adjust to the data range. - If set to'fix', the x and y limits will be fixed to a specific range. The fixed range is from the min to max of data plus 5% margin.
- save(filename, output_format=None)[source]
save the animation of data to file.
- Parameters:
filename (str) – file name to output
output_format (str, optional) – the output format. Now only support
gif,mp4, andavi. Defaults toNone, meaning the output format is inferred from the filename extension.
- class postmd.animate.animate.CumAnimate(*args, fps: int = 20, dpi: int = 72, range_mode: str = 'auto', mode: str = 'mean')[source]
Bases:
BaseAnimateThe cumulative animation of a set of data, which is usually for show the change of data with number of experiments or cumulative average.
- Parameters:
*args – a set of y data
(ydata1, ydata2, ...), orx, (ydata1, ydata2, ...). Each ydata should be a 1D array.fps (int, optional) – Frames per second (FPS) setting for animation. Defaults to
20.dpi (int, optional) – Dots per inch (DPI) resolution for animation. Defaults to
72.range_mode (str, optional) – Determines the behavior of x and y limits in the animation. Defaults to
'auto'. - If set to'auto', the x and y limits will automatically adjust to the data range. - If set to'fix', the x and y limits will be fixed to a specific range. The fixed range is from the min to max of data plus 5% margin.mode (str, optional) –
"mean","sum"or"mean". Defaults to None. - Ifmode="mean", the cumulative average of(ydata1, ydata2, ...)will display in order as animation. The n-th frame is(ydata1+ydata2+...+ydatan)/n- Ifmode="sum", the cumulative summation of(ydata1, ydata2, ...)will display in order as animation. The n-th frame isydata1+ydata2+...+ydatan- Ifmode="sequence",ydata1,ydata2, … will display in sequence as animation
- save(filename, output_format=None)[source]
save the animation of data to file.
- Parameters:
filename (str) – file name to output
output_format (str, optional) – the output format. Now only support
gif,mp4, andavi. Defaults toNone, meaning the output format is inferred from the filename extension.