postmd.animate package

class postmd.animate.AppendAnimate(*args, fps=20, dpi=72, range_mode='auto')[source]

Bases: Animate

animate data by appending data to the figure.

Parameters:
  • *args – a set of y data (ydata1, ydata2, ...), or x, (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.

show()[source]

show the animation of data.

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, and avi. Defaults to None, 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: Animate

The 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, ...), or x, (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. - If mode="mean", the cumulative average of (ydata1, ydata2, ...) will display in order as animation. The n-th frame is (ydata1+ydata2+...+ydatan)/n - If mode="sum", the cumulative summation of (ydata1, ydata2, ...) will display in order as animation. The n-th frame is ydata1+ydata2+...+ydatan - If mode="sequence", ydata1, ydata2, … will display in sequence as animation

show()[source]

show the animation of data.

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, and avi. Defaults to None, meaning the output format is inferred from the filename extension.

Submodules

postmd.animate.animate module

class postmd.animate.animate.Animate(*args, fps=20, dpi=72)[source]

Bases: object

show()[source]

show the animation of data.

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, and avi. Defaults to None, meaning the output format is inferred from the filename extension.

postmd.animate.append_animate module

class postmd.animate.append_animate.AppendAnimate(*args, fps=20, dpi=72, range_mode='auto')[source]

Bases: Animate

animate data by appending data to the figure.

Parameters:
  • *args – a set of y data (ydata1, ydata2, ...), or x, (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.

show()[source]

show the animation of data.

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, and avi. Defaults to None, meaning the output format is inferred from the filename extension.

postmd.animate.cum_animate module

class postmd.animate.cum_animate.CumAnimate(*args, fps: int = 20, dpi: int = 72, range_mode: str = 'auto', mode: str = 'mean')[source]

Bases: Animate

The 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, ...), or x, (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. - If mode="mean", the cumulative average of (ydata1, ydata2, ...) will display in order as animation. The n-th frame is (ydata1+ydata2+...+ydatan)/n - If mode="sum", the cumulative summation of (ydata1, ydata2, ...) will display in order as animation. The n-th frame is ydata1+ydata2+...+ydatan - If mode="sequence", ydata1, ydata2, … will display in sequence as animation

show()[source]

show the animation of data.

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, and avi. Defaults to None, meaning the output format is inferred from the filename extension.