anim.plane.colorbar

class anim.plane.colorbar(colormap, title=None, ticks_color='grey', ticks_number=2, ticks_precision=2, ticks_fontname='Helvetica', ticks_fontsize=0.05, ticks_style='', group=None, x=0, y=0, position=None, Lx=None, Ly=None, dimension=None, center=[True, True], center_of_rotation=[0, 0], orientation=0, zvalue=0, draggable=False)

Colorbar item (composite)

### WARNING ### WARNING ### WARNING ### WARNING ### WARNING ###

!! This is not finished !!

### WARNING ### WARNING ### WARNING ### WARNING ### WARNING ###

A colorbar is defined by its:

  • position and dimension. The reference point is the center of the colorbar

    rectangle, and the dimensions are those of the colorbar rectangle. The ticks take some extra space.

  • colormap

  • ticks

Parameters ══════════

  • name

    str The colormap’s name

  • colormap

    anim.colormap The colormap associated with the colorbar

  • title

    str, [* str(*)] default: ‘’ The colorbar title. HTML formating is supported by default.

  • group

    anim.plane.group default: None The colorbar’s group. If None, the position of the reference point is in absolute coordinates. Otherwise, the positions are relative to the group’s reference point.

─── position ────────────────────────────────

  • x

    float default: 0 x-position of the reference point.

  • y

    float default: 0 y-position of the reference point.

  • position

    (float, float), [float, float], complex default: [0,0] Position of the reference point. The user can define either x, y or the position. In case of conflict, the position attribute wins.

  • center

    (bool, bool), [bool, bool], bool default: [True,True] Boolean defining the centering around the reference point. For tuple and list the first element is for the x-axis and the second is for the y-axis.

─── dimensions ──────────────────────────────

  • Lx

    float The colorbar rectangle width, i.e. length along the x axis when orientation is 0.

  • Ly

    float The colorbar rectangle height, i.e.length along the y axis when orientation is 0.

  • dimension

    (float, float), [float, float], complex default: [0,0] Dimensions along the x and y axes when orientation is 0. The user must define either Lx, Ly or the dimension array. In case of conflicting definitions, the dimension attribute wins.

─── ticks ───────────────────────────────────

  • ticks_number

    int >1 default: 2 Number of ticks to display. This property cannot be changed dynamically after the initialization of the colorbar.

  • ticks_precision

    int >=0 default: 2 Number of precision digits for the ticks

  • ticks_color

    str, QColor default: ‘grey’ Color of the ticks and colorbar contour.

─── transformations ─────────────────────────

  • draggable

    bool default: False Boolean specifying if the colorbar can be dragged. If True, the dragging callback is defined in the ‘itemChange’ method of the event class, which is transfered to the canva’s ‘event’ method (recommended).

─── stack ───────────────────────────────────

  • zvalue

    float default: 0 Z-value (stack order) of the colorbar.

─── style ────────────────────────────────

  • ticks_fontname

    str default: ‘Helvetica’ Ticks font name

  • ticks_fontsize

    float default: 0.05 Ticks font size, in scene units.

  • ticks_style

    str default: ‘’ Ticks css style sheet. Global styling is accessed through the html selector. Example: ‘html { background-color: yellow; }’

__init__(colormap, title=None, ticks_color='grey', ticks_number=2, ticks_precision=2, ticks_fontname='Helvetica', ticks_fontsize=0.05, ticks_style='', group=None, x=0, y=0, position=None, Lx=None, Ly=None, dimension=None, center=[True, True], center_of_rotation=[0, 0], orientation=0, zvalue=0, draggable=False)

Colorbar item constructor

Methods

__init__(colormap[, title, ticks_color, ...])

Colorbar item constructor

initialize()

Initialize the item

rotate(angle)

Relative rotation

setColormap()

Sets the colormap grandient in the rectangle item

setGeometry()

Colorbar geometry

setOrientation()

Set the qitem orientation

setPosition([position])

Sets the qitem's position.

translate(dx[, dy])

Relative translation

Attributes

Lx

Ly

center

center_of_rotation

clickable

colormap

dimension

draggable

group

orientation

position

ticks_color

ticks_fontname

ticks_fontsize

ticks_number

x

y

zvalue