IDL: Can IDL add a colorbar/other legend info below a contour plot, so that it doesn't overlap anything?
-
24-10-2019 - |
Question
I am using a map_set call to draw a map, and then using contour to plot some data on top of it.
I want to add a legend to this plot to make it useful, but it would have to be below the entire plot, and everything I've tried creates an overlapping legend over top of my image.
Solution
Can you do two plots -- one for your contour map, and another for the colorbar/legend,
using the system variable !P.MULTI
to lay them out one above the other? You might also
need to specify YMARGIN
keywords appropriately on each plot to keep them from overlapping.
OTHER TIPS
You use pre-written colorbar routines (cbar from JHU or colorbar from Coyote, for example) and use the POSITION keyword to put them exactly where you want them. You can also pass POSITION to MAP_SET to position that where you want it.