salem.Map.set_scale_bar

Map.set_scale_bar(location=None, length=None, maxlen=0.25, add_bbox=False, bbox_dx=1.2, bbox_dy=1.2, bbox_kwargs=None, **kwargs)[source]

Add a legend bar showing the scale to the plot.

Parameters:
locationtuple

the location of the bar (in the plot’s relative coordinates)

lengthfloat

the length of the bar in proj units (m or deg). Default is to find the nicest number satisfying maxlen

maxlenfloat

the maximum lenght of the bar (in the plot’s relative coordinates) when choosing the length automatically

add_bboxbool

add a bounding box to the scale bar (WIP: experimental)

bbox_dxbool, default: 1.2

a multiplicating factor controlling the x size of the bounding box (trial and error works best for this one)

bbox_dybool, default: 1.2

a multiplicating factor controlling the y size of the bounding box (trial and error works best for this one)

bbox_kwargsdict

kwarg to pass to set_geometry() for the bounding box (e.g. facecolor, alpha, etc…)

kwargsdict

any kwarg accepted by set_geometry. Defaults are put on color, linewidth, text, text_kwargs… But you can do whatever you want