sidpy.viz.plot_utils.image.plot_map¶
- sidpy.viz.plot_utils.image.plot_map(axis, img, show_xy_ticks=True, show_cbar=True, x_vec=None, y_vec=None, num_ticks=4, stdevs=None, cbar_label=None, tick_font_size=None, infer_aspect=False, **kwargs)[source]¶
Plots an image within the given axis with a color bar + label and appropriate X, Y tick labels. This is particularly useful to get readily interpretable plots for papers
- Parameters:
axis (matplotlib.axes.Axes object) – Axis to plot this image onto
img (2D numpy array with real values) – Data for the image plot
show_xy_ticks (bool, Optional, default = None, shown unedited) – Whether or not to show X, Y ticks
show_cbar (bool, optional, default = True) – Whether or not to show the colorbar
x_vec (1-D array-like or Number, optional) – if an array-like is provided, these will be used for the tick values on the X axis if a Number is provided, this will serve as an extent for tick values in the X axis. For example x_vec=1.5 would cause the x tick labels to range from 0 to 1.5
y_vec (1-D array-like or Number, optional) – if an array-like is provided - these will be used for the tick values on the Y axis if a Number is provided, this will serve as an extent for tick values in the Y axis. For example y_vec=225 would cause the y tick labels to range from 0 to 225
num_ticks (unsigned int, optional, default = 4) – Number of tick marks on the X and Y axes
stdevs (unsigned int (Optional. Default = None)) – Number of standard deviations to consider for plotting. If None, full range is plotted.
cbar_label (str, optional, default = None) – Labels for the colorbar. Use this for something like quantity (units)
tick_font_size (unsigned int, optional, default = None) – Font size to apply to x, y, colorbar ticks and colorbar label
infer_aspect (bool, Optional. Default = False) – Whether or not to adjust the aspect ratio of the image based on the provided x_vec and y_vec The values of x_vec and y_vec will be assumed to have the same units.
kwargs (dictionary) – Anything else that will be passed on to matplotlib.pyplot.imshow
- Returns:
im_handle (handle to image plot) – handle to image plot
cbar (handle to color bar) – handle to color bar
Note
The origin of the image will be set to the lower left corner. Use the kwarg ‘origin’ to change this