Closed sterre closed 5 years ago
@sterre this sounds good to me with one caveat. SigPlot allows you to combine 2D and 1D layers within the same plot (or multiple 2-D layers with different capacities) so it might be more appropriate to check all of the layers within Gx.lyr to see if any of them are 2D. If so, then a colorbar will be displayed.
Sound good?
Yes, that makes sense to me.
@sterre sorry this took so long for me to get around to. I just published a pull request.
A SigPlot instance always displays a colorbar, even if all layers are 1d. Since the colorbar is not related to the display in this case, it seems extraneous.
I believe the relevant code is in
display_specs
. There's a conditional which checks whether to display a large colorbar based onGx.lg_colorbar
AND the class of layer zero. The else clause unconditionally draws a colorbar:If we separate the class check from the large/small check, we could skip the drawing altogether:
An alternative would be to have another option explicitly controlling whether the colorbar is drawn, but that seems less humane to me for the straightforward case.