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: - location : tuple
the location of the bar (in the plot’s relative coordinates)
- length : float
the length of the bar in proj units (m or deg). Default is to find the nicest number satisfying
maxlen
- maxlen : float
the maximum lenght of the bar (in the plot’s relative coordinates) when choosing the length automatically
- add_bbox : bool
add a bounding box to the scale bar (WIP: experimental)
- bbox_dx : bool, default: 1.2
a multiplicating factor controlling the x size of the bounding box (trial and error works best for this one)
- bbox_dy : bool, default: 1.2
a multiplicating factor controlling the y size of the bounding box (trial and error works best for this one)
- bbox_kwargs : dict
kwarg to pass to set_geometry() for the bounding box (e.g. facecolor, alpha, etc…)
- kwargs : dict
any kwarg accepted by
set_geometry
. Defaults are put oncolor
,linewidth
,text
,text_kwargs
… But you can do whatever you want