Scalebar

class aplpy.Scalebar(parent)[source]

Bases: object

Methods Summary

hide() Hide the scalebar.
set(**kwargs) Modify the scalebar and scalebar properties.
set_alpha(alpha) Set the alpha value (transparency).
set_color(color) Set the label and scalebar color.
set_corner(corner) Set where to place the scalebar.
set_font([family, style, variant, stretch, …]) Set the font of the tick labels
set_font_family(family)
set_font_size(size)
set_font_style(style)
set_font_weight(weight)
set_frame(frame) Set whether to display a frame around the scalebar.
set_label(label) Set the label of the scale bar.
set_length(length) Set the length of the scale bar.
set_linestyle(linestyle) Set the linestyle of the scalebar.
set_linewidth(linewidth) Set the linewidth of the scalebar, in points.
show(length[, label, corner, frame, …]) Overlay a scale bar on the image.

Methods Documentation

hide()[source]

Hide the scalebar.

set(**kwargs)[source]

Modify the scalebar and scalebar properties.

All arguments are passed to the matplotlib Rectangle and Text classes. See the matplotlib documentation for more details. In cases where the same argument exists for the two objects, the argument is passed to both the Text and Rectangle instance.

set_alpha(alpha)[source]

Set the alpha value (transparency).

This should be a floating point value between 0 and 1.

set_color(color)[source]

Set the label and scalebar color.

set_corner(corner)[source]

Set where to place the scalebar.

Acceptable values are ‘left’, ‘right’, ‘top’, ‘bottom’, ‘top left’, ‘top right’, ‘bottom left’ (default), and ‘bottom right’.

set_font(family=None, style=None, variant=None, stretch=None, weight=None, size=None, fontproperties=None)[source]

Set the font of the tick labels

Parameters:
common: family, style, variant, stretch, weight, size, fontproperties

Notes

Default values are set by matplotlib or previously set values if set_font has already been called. Global default values can be set by editing the matplotlibrc file.

set_font_family(family)[source]
set_font_size(size)[source]
set_font_style(style)[source]
set_font_weight(weight)[source]
set_frame(frame)[source]

Set whether to display a frame around the scalebar.

set_label(label)[source]

Set the label of the scale bar.

set_length(length)[source]

Set the length of the scale bar.

set_linestyle(linestyle)[source]

Set the linestyle of the scalebar.

Should be one of ‘solid’, ‘dashed’, ‘dashdot’, or ‘dotted’.

set_linewidth(linewidth)[source]

Set the linewidth of the scalebar, in points.

show(length, label=None, corner='bottom right', frame=False, borderpad=0.4, pad=0.5, **kwargs)[source]

Overlay a scale bar on the image.

Parameters:
length : float, or quantity

The length of the scalebar in degrees, an angular quantity, or angular unit

label : str, optional

Label to place below the scalebar

corner : int, optional

Where to place the scalebar. Acceptable values are:, ‘left’, ‘right’, ‘top’, ‘bottom’, ‘top left’, ‘top right’, ‘bottom left’ (default), ‘bottom right’

frame : str, optional

Whether to display a frame behind the scalebar (default is False)

kwargs

Additional arguments are passed to the matplotlib Rectangle and Text classes. See the matplotlib documentation for more details. In cases where the same argument exists for the two objects, the argument is passed to both the Text and Rectangle instance.