Add input parameter 'drawScale', true|false, which defines a priori whether the scale should be drawn. If not, the plot area will not be rescaled to make room for the bar.
Also, if this property is changed after construction, adjust the plot size accordingly: If it is turned on, decrease the size and draw the bar. If it is turned off, increase the size (trying to restore the original position will probably be hard to impossible) and delete the scalebar; also, set 'drawScale' to false when the scalebar is deleted.
This would have the advantage that histograms where the scale is not desired are not automatically downsized, efficiently using the figure space.
Add input parameter
'drawScale',true|false, which defines a priori whether the scale should be drawn. If not, the plot area will not be rescaled to make room for the bar.Also, if this property is changed after construction, adjust the plot size accordingly: If it is turned on, decrease the size and draw the bar. If it is turned off, increase the size (trying to restore the original
positionwill probably be hard to impossible) anddeletethe scalebar; also, set'drawScale'tofalsewhen the scalebar isdeleted.This would have the advantage that histograms where the scale is not desired are not automatically downsized, efficiently using the figure space.