You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug earthpy.plot.plot_bands method ignores ax keyword argument if raster has multiple bands
To Reproduce
Steps to reproduce the behavior:
If raster is an array with raster.ndim > 2 and raster.shape[0] > 1, then the ax keyword
argument has no effect and the plot_bands method produces a new axes array. The user has
no access to the figure object to customize the plot.
import earthpy.plot as ep
import matplotlib.pyplot as plt
fig, axs = plt.subplots(3, 1)
ep.plot_bands(raster, ax=axs)
will produce an output that looks like
Expected behavior
Ideally, if an axis grid consistent with the number of bands is passed in the ax keyword argument, the method would use these axes objects as expected. If this is not feasible, an error message indicating that the ax keyword is not supported when multi-band arrays are provided is needed to avoid confusion.