Colorbar

class aplpy.Colorbar(parent)[source]

Bases: object

Methods Summary

hide(self)

set_axis_label_font(self[, family, style, …])

Set the font of the tick labels.

set_axis_label_pad(self, axis_label_pad)

Set the colorbar label displacement, in points.

set_axis_label_rotation(self, …)

Set the colorbar label rotation.

set_axis_label_text(self, axis_label_text)

Set the colorbar label text.

set_box(self, box[, box_orientation])

Set the box within which to place the colorbar.

set_font(self[, family, style, variant, …])

Set the font of the tick labels.

set_frame_color(self, color)

Set the color of the colorbar frame, in points.

set_frame_linewidth(self, linewidth)

Set the linewidth of the colorbar frame, in points.

set_label_properties(self, *args, **kwargs)

set_labels(self, labels)

Set whether to show numerical labels.

set_location(self, location)

Set the location of the colorbar.

set_pad(self, pad)

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

set_ticks(self, ticks)

Set the position of the ticks on the colorbar.

set_width(self, width)

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

show(self[, location, width, pad, ticks, …])

Show a colorbar on the side of the image.

update(self)

Methods Documentation

hide(self)[source]
set_axis_label_font(self, 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(self, axis_label_pad)[source]

Set the colorbar label displacement, in points.

set_axis_label_rotation(self, axis_label_rotation)[source]

Set the colorbar label rotation.

set_axis_label_text(self, axis_label_text)[source]

Set the colorbar label text.

set_box(self, 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(self, 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(self, color)[source]

Set the color of the colorbar frame, in points.

set_frame_linewidth(self, linewidth)[source]

Set the linewidth of the colorbar frame, in points.

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

Set whether to show numerical labels.

set_location(self, location)[source]

Set the location of the colorbar.

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

set_pad(self, pad)[source]

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

set_ticks(self, ticks)[source]

Set the position of the ticks on the colorbar.

set_width(self, width)[source]

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

show(self, 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(self)[source]