Colorbar

class aplpy.Colorbar(parent)[source]

Bases: object

Methods Summary

hide()

set_axis_label_font([family, style, ...])

Set the font of the tick labels.

set_axis_label_pad(axis_label_pad)

Set the colorbar label displacement, in points.

set_axis_label_rotation(axis_label_rotation)

Set the colorbar label rotation.

set_axis_label_text(axis_label_text)

Set the colorbar label text.

set_box(box[, box_orientation])

Set the box within which to place the colorbar.

set_font([family, style, variant, stretch, ...])

Set the font of the tick labels.

set_frame_color(color)

Set the color of the colorbar frame, in points.

set_frame_linewidth(linewidth)

Set the linewidth of the colorbar frame, in points.

set_label_properties(*args, **kwargs)

set_labels(labels)

Set whether to show numerical labels.

set_location(location)

Set the location of the colorbar.

set_pad(pad)

Set the spacing between the colorbar and the image relative to the canvas size.

set_ticks(ticks)

Set the position of the ticks on the colorbar.

set_width(width)

Set the width of the colorbar relative to the canvas size.

show([location, width, pad, ticks, labels, ...])

Show a colorbar on the side of the image.

update()

Methods Documentation

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

Set the font of the tick labels.

Parameters
familystr, optional

The family of the font to use. This can either be a generic font family name, either ‘serif’, ‘sans-serif’, ‘cursive’, ‘fantasy’, or ‘monospace’, or a list of font names in decreasing order of priority.

stylestr, optional

The font style. This can be ‘normal’, ‘italic’ or ‘oblique’.

variantstr, optional

The font variant. This can be ‘normal’ or ‘small-caps’

stretchstr or int or float, optional

The stretching (spacing between letters) for the font. This can either be a numeric value in the range 0-1000 or one of ‘ultra-condensed’, ‘extra-condensed’, ‘condensed’, ‘semi-condensed’, ‘normal’, ‘semi-expanded’, ‘expanded’, ‘extra-expanded’ or ‘ultra-expanded’.

weightstr or int or float, optional

The weight (or boldness) of the font. This can either be a numeric value in the range 0-1000 or one of ‘ultralight’, ‘light’, ‘normal’, ‘regular’, ‘book’, ‘medium’, ‘roman’, ‘semibold’, ‘demibold’, ‘demi’, ‘bold’, ‘heavy’, ‘extra bold’, ‘black’.

sizestr or int or float, optional

The size of the font. This can either be a numeric value (e.g. 12), giving the size in points, or one of ‘xx-small’, ‘x-small’, ‘small’, ‘medium’, ‘large’, ‘x-large’, or ‘xx-large’.

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_axis_label_pad(axis_label_pad)[source]

Set the colorbar label displacement, in points.

set_axis_label_rotation(axis_label_rotation)[source]

Set the colorbar label rotation.

set_axis_label_text(axis_label_text)[source]

Set the colorbar label text.

set_box(box, box_orientation='vertical')[source]

Set the box within which to place the colorbar.

This should be in the form [xmin, ymin, dx, dy] and be in relative figure units. The orientation of the colorbar within the box can be controlled with the box_orientation argument.

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
familystr, optional

The family of the font to use. This can either be a generic font family name, either ‘serif’, ‘sans-serif’, ‘cursive’, ‘fantasy’, or ‘monospace’, or a list of font names in decreasing order of priority.

stylestr, optional

The font style. This can be ‘normal’, ‘italic’ or ‘oblique’.

variantstr, optional

The font variant. This can be ‘normal’ or ‘small-caps’

stretchstr or int or float, optional

The stretching (spacing between letters) for the font. This can either be a numeric value in the range 0-1000 or one of ‘ultra-condensed’, ‘extra-condensed’, ‘condensed’, ‘semi-condensed’, ‘normal’, ‘semi-expanded’, ‘expanded’, ‘extra-expanded’ or ‘ultra-expanded’.

weightstr or int or float, optional

The weight (or boldness) of the font. This can either be a numeric value in the range 0-1000 or one of ‘ultralight’, ‘light’, ‘normal’, ‘regular’, ‘book’, ‘medium’, ‘roman’, ‘semibold’, ‘demibold’, ‘demi’, ‘bold’, ‘heavy’, ‘extra bold’, ‘black’.

sizestr or int or float, optional

The size of the font. This can either be a numeric value (e.g. 12), giving the size in points, or one of ‘xx-small’, ‘x-small’, ‘small’, ‘medium’, ‘large’, ‘x-large’, or ‘xx-large’.

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_frame_color(color)[source]

Set the color of the colorbar frame, in points.

set_frame_linewidth(linewidth)[source]

Set the linewidth of the colorbar frame, in points.

set_label_properties(*args, **kwargs)[source]
set_labels(labels)[source]

Set whether to show numerical labels.

set_location(location)[source]

Set the location of the colorbar.

Should be one of ‘left’, ‘right’, ‘top’, ‘bottom’.

set_pad(pad)[source]

Set the spacing between the colorbar and the image relative to the canvas size.

set_ticks(ticks)[source]

Set the position of the ticks on the colorbar.

set_width(width)[source]

Set the width of the colorbar relative to the canvas size.

show(location='right', width=0.2, pad=0.05, ticks=None, labels=True, log_format=False, box=None, box_orientation='vertical', axis_label_text=None, axis_label_rotation=None, axis_label_pad=5)[source]

Show a colorbar on the side of the image.

Parameters
locationstr, optional

Where to place the colorbar. Should be one of ‘left’, ‘right’, ‘top’, ‘bottom’.

widthfloat, optional

The width of the colorbar relative to the canvas size.

padfloat, optional

The spacing between the colorbar and the image relative to the canvas size.

tickslist, optional

The position of the ticks on the colorbar.

labelsbool, optional

Whether to show numerical labels.

log_formatbool, optional

Whether to format ticks in exponential notation

boxlist, optional

A custom box within which to place the colorbar. This should be in the form [xmin, ymin, dx, dy] and be in relative figure units. This overrides the location argument.

box_orientation str, optional

The orientation of the colorbar within the box. Can be ‘horizontal’ or ‘vertical’

axis_label_text str, optional

Optional text label of the colorbar.

update()[source]