earthpy icon indicating copy to clipboard operation
earthpy copied to clipboard

Add custom legends with plot_bands

Open lwasser opened this issue 5 years ago • 0 comments

Right now you need to use core MPL to create a custom legend with earthpy. it would be much nicer if you could simply call a custom legend from within plot_bands.

# Create a colormap from a list of colors
cmap = ListedColormap(colors)

f, ax = plt.subplots()
im = ax.imshow(lidar_chm_class_ma, 
               cmap=cmap)
ep.draw_legend(im, titles=height_class_labels)
ax.set_axis_off()
plt.show()

lwasser avatar Jan 22 '20 19:01 lwasser