scportrait.plotting.add_scalebar

Contents

scportrait.plotting.add_scalebar#

scportrait.plotting.add_scalebar(ax: Axes, resolution: float, resolution_unit: str = 'um', fixed_length: float | None = None, location: str = 'lower right', color: str = 'white', scale_loc: str = 'bottom', border_pad=1) None#

Add a scalebar to an axis.

This function wraps the package matplotlib-scalebar. Please utilize the original package if you require more customization.

Parameters:
  • ax – The axis to add the scalebar to.

  • resolution – The resolution of the image.

  • resolution_unit – The unit of the resolution.

  • fixed_length – specify the absolute length of the scale bar

  • location – The location of the scalebar.

  • color – The color of the scalebar.

  • scale_location – where the text labelling the scale par should be located relative to the bar. If set to “none” then there will be no label.

  • border_pad – distance between scalebar element and border of the image.