Skip to content

GC.theme() ​

Set the theme of the chart.

A theme sets the default look of every part of the chart: fonts, text and line colours, the background, the gene colours and the options of each component. Options set with the other methods (e.g. labels(font_size=...)) take precedence over the theme, whatever the order of the calls. Call it with a theme to start from that theme, or without one to change the current theme.

Usage ​

python
chart.theme(
    theme,
    text_scale,
    font_family,
    text_color,
    line_color,
    background,
    palette,
    pattern,
    **options,
)

An argument shown without a default is optional too: left out, the chart keeps its default.

chart is a GC chart.

Arguments ​

ArgumentTypeDescription
themestr or dict, optionalA built-in theme: "default", "classic", "dark", "vintage", "infographic", "publication" or "bw" (black and white, with a pattern per group); or theme settings (see geneviewer_theme). Default: change the current theme.
text_scalefloat, optionalText size, as a factor of the default font sizes.
font_familystr, optionalFont of all text.
text_colorstr, optionalColour of all text.
line_colorstr, optionalColour of the sequence line, the axis, the coordinates, the scale bar and the lines of spread labels.
backgroundstr, optionalBackground colour of the chart.
palettestr or list of str, optionalGene colours: a d3 colour scheme, a geneviewer palette (see geneviewer_palette), or a list of colours.
patterndict or bool, optionalPatterns of the genes, with the arguments of pattern() (patterns, color, background, size, strokeWidth). False removes the patterns of the theme.
**optionsOptions per component, as dicts named after the component: chart, grid, cluster, title, cluster_title, cluster_footer, cluster_label, sequence, genes, transcript, labels, coordinates, scale, scale_bar, legend, links, tooltip, track_mouse, toolbar and annotations, e.g. labels={"fontSize": "10px"}. None removes a component from the theme.

Value ​

GC: The chart.