plotlib module¶
-
class
IMTreatment.plotlib.plotlib.
ButtonManager
(displayers, xlabel='', ylabel='', sharecb=True, normcb=None, play_interval=2)[source]¶ Bases:
object
-
save_animation
(animpath, fields='all', writer='ffmpeg', fps=24, title='', artist='IMTreatment', comment='', bitrate=-1, codec='ffv1', dpi=150)[source]¶ Save the button manager displays as an animation.
Parameters: - animpath (string) – Path where to save animation
- fields (string or 2x1 list of numbers) – Fields interval to save. Default is ‘all’ for all the fields.
- writer (string) – Name of the writer to use (available writers are listed in ‘matplotlib.animation.writers.list()’
- codec (string) – One of the codec of the choosen writer (default to ‘ffv1’)
- fps (integer) – Number of frame per second (default to 24)
- bitrate (integer) – Video bitrate in kb/s (default to -1) Set this to -1 for letting the writter choose.
- dpi (integer) – dpi of the video images before compression (default to 150)
- artist, comment (title,) – Information added to the file metadata
-
-
class
IMTreatment.plotlib.plotlib.
DataCursorPoints
(ax, tolerance=5, offsets=(-20, 20), formatter=None, display_all=False, color=(0.76, 0.86, 0.92))[source]¶ Bases:
object
-
class
IMTreatment.plotlib.plotlib.
DataCursorTextDisplayer
(displayer, i=None, precision=3)[source]¶ Bases:
object
-
class
IMTreatment.plotlib.plotlib.
Displayer
(x, y, values=None, data_type=None, sharebds=True, buffer_size=100, **kwargs)[source]¶ Bases:
object
-
field_1D_default_args
= {'aspect': 'equal', 'interpolation': 'nearest', 'kind': 'matrix'}¶
-
field_2D_default_args
= {'aspect': 'equal', 'kind': 'quiver'}¶
-
points_default_args
= {'kind': 'scatter'}¶
-
profile_default_args
= {'kind': 'plot'}¶
-
-
class
IMTreatment.plotlib.plotlib.
Formatter
(order=0, fformat='%1.1f', offset=True, mathtext=True)[source]¶ Bases:
matplotlib.ticker.ScalarFormatter
-
IMTreatment.plotlib.plotlib.
colored_plot
(x, y, z=None, log='plot', min_colors=1000, colorbar=False, color_label='', **kwargs)[source]¶ Plot a colored line with coordinates x and y
Parameters: - y (x,) – coordinates of each points
- z (nx1 array of number, optional) – values for the color
- log (string, optional) – Type of axis, can be ‘plot’ (default), ‘semilogx’, ‘semilogy’, ‘loglog’
- min_colors (integer, optional) – Minimal number of different colors in the plot (default to 1000).
- colorbar (bool) –
.
- color_label (string, optional) – Colorbar label if color is an array.
- kwargs (dict, optional) – list of arguments to pass to the common plot (see matplotlib documentation).
-
IMTreatment.plotlib.plotlib.
get_color_gradient
(cmap='jet', number=10)[source]¶ Return a gradient of color for plot uses.
-
IMTreatment.plotlib.plotlib.
make_cmap
(colors, position=None, name='my_cmap')[source]¶ Return a color map cnstructed with the geiven colors and positions.
Parameters: - colors (Nx1 list of 3x1 tuple) – Each color wanted on the colormap. each value must be between 0 and 1.
- positions (Nx1 list of number, optional) – Relative position of each color on the colorbar. default is an uniform repartition of the given colors.
- name (string, optional) – Name for the color map
-
IMTreatment.plotlib.plotlib.
make_discrete_cmap
(interv_centers, cmap=None)[source]¶ Create a discrete map, with intervals centered on the given values.
-
IMTreatment.plotlib.plotlib.
make_segments
(x, y)[source]¶ Create list of line segments from x and y coordinates, in the correct format for LineCollection: an array of the form numlines x (points per line) x 2 (x and y) array
-
IMTreatment.plotlib.plotlib.
mark_axe
(txt, ax=None, loc=2, pad=0.3, borderpad=0.0, font_props=None, frameon=True)[source]¶
-
IMTreatment.plotlib.plotlib.
save_animation
(animpath, fig=None, fields='all', writer='ffmpeg', fps=24, title='', artist='IMTreatment', comment='', bitrate=-1, codec='ffv1', dpi=150)[source]¶ Save the current button manager displays as an animation.
Parameters: - animpath (string) – Path where to save animation
- fig (Figure instance) – Figure to save the animation from (if None, get the current one)
- fields (string or 2x1 list of numbers) – Fields interval to save. Default is ‘all’ for all the fields.
- writer (string) – Name of the writer to use (available writers are listed in ‘matplotlib.animation.writers.list()’
- codec (string) – One of the codec of the choosen writer (default to ‘ffv1’)
- fps (integer) – Number of frame per second (default to 24)
- bitrate (integer) – Video bitrate in kb/s (default to -1) Set this to -1 for letting the writter choose.
- dpi (integer) – dpi of the video images before compression (default to 150)
- artist, comment (title,) – Information added to the file metadata