hyperspy.drawing._widgets.scalebar module¶
-
class
hyperspy.drawing._widgets.scalebar.ScaleBar(ax, units, pixel_size=None, color='white', position=None, max_size_ratio=0.25, lw=2, length=None, animated=False)¶ Bases:
objectAdd a scale bar to an image.
- axmatplotlib axes
The axes where to draw the scale bar.
units : string pixel_size : {None, float}
If None the axes of the image are supposed to be calibrated. Otherwise the pixel size must be specified.
color : a valid matplotlib color position {None, (float, float)}
If None the position is automatically determined.
- max_size_ratiofloat
The maximum size of the scale bar in respect to the length of the x axis
- lwint
The line width
- length{None, float}
If None the length is automatically calculated using the max_size_ratio.
-
calculate_line_position(pad=0.05)¶
-
calculate_size(max_size_ratio=0.25)¶
-
calculate_text_position(pad=0.01)¶
-
get_units_string()¶
-
plot_scale(line_width=1)¶
-
remove()¶
-
set_color(c)¶
-
set_length(length)¶
-
set_tex_bold()¶