dianna.visualization.image ========================== .. py:module:: dianna.visualization.image Functions --------- .. autoapisummary:: dianna.visualization.image._determine_vmax dianna.visualization.image.plot_image Module Contents --------------- .. py:function:: _determine_vmax(max_data_value) .. py:function:: plot_image(heatmap: numpy.ndarray, original_data: Optional[numpy.ndarray] = None, heatmap_cmap='bwr', heatmap_range=(None, None), data_cmap=None, show_plot: bool = True, output_filename=None, ax: Optional[matplotlib.pyplot.Axes] = None) -> matplotlib.pyplot.Figure Plots a heatmap image. Optionally, the heatmap (typically a saliency map of an explainer) can be plotted on top of the original data. In that case both images are plotted transparantly with alpha = 0.5. :param heatmap: the saliency map or other heatmap to be plotted. :param original_data: the data to plot together with the heatmap, both with alpha = 0.5 (optional). :param heatmap_cmap: color map for the heatmap plot (see mpl.Axes.imshow documentation for options). :param heatmap_range: a tuple (vmin, vmax) to set the range of the heatmap. By default, the colormap covers the complete value range of the supplied heatmap. :param data_cmap: color map for the (optional) data image (see mpl.Axes.imshow documentation for options). By default, if the image is two dimensional, the color map is set to 'gray'. :param show_plot: Shows plot if true (for testing or writing plots to disk instead). :param output_filename: Name of the file to save the plot to (optional). :param ax: matplotlib.Axes object to plot on (optional). :returns: None