VisualAttributes

class glue.core.visual.VisualAttributes(parent=None, color=None, alpha=None, preferred_cmap=None, linewidth=1, linestyle='solid', marker='o', markersize=3)[source]

Bases: HasCallbackProperties

This class is used to define visual attributes for any kind of objects.

Parameters
parentQObject, optional

The object that this visual attributes object is attached to. Default is None.

colorstr, optional

A matplotlib color string. Default is set from SettingRegistry.

alphafloat, optional

Opacity, between 0-1. Default is set from SettingRegistry.

preferred_cmapstr or Colormap, optional

A colormap to be used as the preferred colormap, by name or instance. Default is None.

linewidthfloat, optional

The linewidth. Default is 1.

linestylestr, optional

The linestyle. Default is ‘solid’.

markerstr, optional

The matplotlib marker shape. Default is ‘o’.

markersizefloat, optional

The size of the marker. Default is 3.

Attributes Summary

DEFAULT_ATTS

alpha

Transparency, given as a floating point value between 0 and 1.

color

Color specified using Matplotlib notation

linestyle

The line style, which can be one of 'solid', 'dashed', 'dash-dot', 'dotted', or 'none'.

linewidth

The line width, in points.

marker

The marker symbol.

markersize

preferred_cmap

A preferred colormap specified using Matplotlib notation

rgba

Methods Summary

copy([new_parent])

Create a new instance with the same visual properties

set(other)

Update this instance's properties based on another VisualAttributes instance.

Attributes Documentation

DEFAULT_ATTS = ['color', 'alpha', 'linewidth', 'linestyle', 'marker', 'markersize', 'preferred_cmap']
alpha[source]

Transparency, given as a floating point value between 0 and 1.

color[source]

Color specified using Matplotlib notation

Specifically, it can be:

  • A string with a common color (e.g. ‘black’, ‘red’, ‘orange’)

  • A string containing a float in the rng [0:1] for a shade of gray (‘0.0’ = black,’1.0’ = white)

  • A tuple of three floats in the rng [0:1] for (R, G, B)

  • An HTML hexadecimal string (e.g. ‘#eeefff’)

linestyle[source]

The line style, which can be one of ‘solid’, ‘dashed’, ‘dash-dot’, ‘dotted’, or ‘none’.

linewidth[source]

The line width, in points.

marker[source]

The marker symbol.

markersize[source]
preferred_cmap[source]

A preferred colormap specified using Matplotlib notation

rgba[source]

Methods Documentation

copy(new_parent=None)[source]

Create a new instance with the same visual properties

set(other)[source]

Update this instance’s properties based on another VisualAttributes instance.