pyamr.graphics package
Submodules
pyamr.graphics.antibiogram module
Classes:
|
- class pyamr.graphics.antibiogram.Antibiogram(column_organism='SPECIE', column_antibiotic='ANTIBIOTIC', column_genus='GENUS', column_category='CATEGORY', column_index='SARI', colormap_genus='nipy_spectral', colormap_category='tab20b', discard_intrinsic=False)[source]
Bases:
object
Attributes:
Methods:
fit
(dataframe)This method fits the antibiogram to the data.
plot
([organisms, antibiotics, genera, ...])This function plots the antibiogram.
- c_abx = 'ANTIBIOTIC'
- c_cat = 'CATEGORY'
- c_gen = 'GENUS'
- c_idx = 'SARI'
- c_org = 'SPECIE'
- fit(dataframe)[source]
This method fits the antibiogram to the data.
- Parameters:
dataframe (pd.DataFrame) – The…
- Return type:
Antibiogram instance
- plot(organisms=None, antibiotics=None, genera=None, categories=None, method='weighted', metric='euclidean', vmin=0.0, vmax=1.0, cmap=None, figsize=(5, 5), xticklabels=True, yticklabels=True, **kwargs)[source]
This function plots the antibiogram.
The arguments are those to be passed to the clustermap implementation which is available on seaborn.
- Parameters:
method (string-like)
metric (string-like)
vmin, vmax (float-like, float-like) – The min and maximum values within the matrix (or feasible range).
cmap (string-like) – The colormap to be used to plot the resistance indexes.
figsize (tuple-like) – The size of the figure
- Return type:
an axis object
pyamr.graphics.table_graph module
Classes:
- class pyamr.graphics.table_graph.TableGraph[source]
Bases:
object
Attributes:
Methods:
get_map_config
([title, xlim, xsym, xticks, ...])This function helps creating a configuration map.
plot
(data, **kwargs)plot_array
(x[, ax, ax_kwargs, cmap_kwargs, ...])this method plots a single column.
plot_dataframe
(dataframe[, axes, configuration])This method plots the whole table.
plot_matrix
(data[, axes, ylabels, clabels, ...])This method plots a matrix.
plot_vertical_line
(ax, top, xv[, bg, lw, cb])This function adds a vertical line and background
- fontsize = 9
- get_map_config(title=None, xlim=None, xsym=False, xticks=None, xline=[], vmin=None, vmax=None, vsym=False, cmap='Blues', midpoint=None, s=80, linewidths=0.75, edgecolor='gray', **kwargs)[source]
This function helps creating a configuration map.
- plot_array(x, ax=None, ax_kwargs={}, cmap_kwargs={}, scatter_kwargs={}, **kwargs)[source]
this method plots a single column.
- Parameters:
x (values to plot.)
ax (axis to plot the information.)
ax_kwargs (axis configuration information.)
cmap_kwargs (cmap configuration information.)
scatter_kwargs (scatter configuration information.)
- Returns:
axis
- Return type:
the axis in which the series is plotted.
- plot_dataframe(dataframe, axes=None, configuration={})[source]
This method plots the whole table.
- Parameters:
dataframe
configuration
- plot_matrix(data, axes=None, ylabels=None, clabels=None, configuration={})[source]
This method plots a matrix.
- Parameters:
data
ylabels
configuration
- plot_vertical_line(ax, top, xv, bg=None, lw=1.0, cb=None)[source]
This function adds a vertical line and background
- Parameters:
ax (the axis to plot the line.)
top (the height of the vertical line.)
xv (the x value where the line should be placed.)
bg (the x value where the background should be extended.)
- class pyamr.graphics.table_graph.TableGraph2[source]
Bases:
object
Methods:
add_vline
(ax, top, xv[, bg])This function adds a vertical line and background
check_vmin_vmax
(x, kwargs)This methos check the vmax and vmin for colors.
display_column
(x, y, cmap, ax, **kwargs)This method displays a single column.
plot
(df, axes, information)This method plots the whole table.
pyamr.graphics.utils_to_delete module
Classes:
|
Normalise the colorbar so that diverging bars |
Functions:
|
This function adds a vertical line and background |
|
This method creates a colormap based on values. |
|
This function adds a vertical line and background |
- class pyamr.graphics.utils_to_delete.MidpointNormalize(vmin=None, vmax=None, midpoint=None, clip=False)[source]
Bases:
Normalize
- Normalise the colorbar so that diverging bars
work there way either side from a prescribed midpoint value)
Example
> MidpointNormalize(midpoint=0., vmin=-100, vmax=100)
- pyamr.graphics.utils_to_delete.hlinebgplot(ax, right, yv, bg=None)[source]
This function adds a vertical line and background
- pyamr.graphics.utils_to_delete.scalar_colormap(values, cmap, vmin, vmax)[source]
This method creates a colormap based on values.
- Parameters:
values (array-like) – The values to create the corresponding colors
cmap (str) – The colormap
vmin, vmax (float) – The minimum and maximum possible values
- Return type:
scalar colormap