cellfish.plot.CircleLabels#

class cellfish.plot.CircleLabels(labels, split_groups=None, palette=None, dot_size=100, fontsize=12, text_color='black', spacing=2, **kwargs)#

Draw colored dots with text labels beside them (Marsilea RenderPlan).

Attributes table#

allow_labeling

allow_split

deform

has_deform

If the RenderPlan has Deformation

is_body

Draw on top and bottom

is_flank

Draw on left and right

is_split

For the RenderPlan to self-aware of whether its render canvas will be split.

label

name

render_main

side

size

zorder

Methods table#

data_validator(data[, target])

get_canvas_size(figure[, main_height, ...])

If the size is unknown before rendering, this function must be implemented to return the canvas size in inches.

get_data()

get_deform_func()

get_group_data()

get_group_params()

get_legends()

This should define the legend return by the RenderPlan.

get_params()

get_render_spec(axes)

get_split_regroup()

reindex_by_chunk(group_data)

render(ax)

This function will be call when render a plot

render_ax(spec)

The major rendering function Define how the plot is drawn

set(**kwargs)

set_data(*data)

set_deform(deform)

set_group_data(group_data)

set_group_params(group_params)

set_label(label[, loc, props])

set_legends(**kwargs)

Update the options passed to the legend built by get_legends().

set_params(params)

set_side(side)

set_size(size)

set_split_regroup(ratio)

update_main_canvas_size()

Attributes#

CircleLabels.allow_labeling: bool = True#
CircleLabels.allow_split: bool = True#
CircleLabels.deform: Deformation = None#
CircleLabels.has_deform#

If the RenderPlan has Deformation

CircleLabels.is_body#

Draw on top and bottom

CircleLabels.is_flank#

Draw on left and right

CircleLabels.is_split#

For the RenderPlan to self-aware of whether its render canvas will be split. Useful to determine how to get render data.

CircleLabels.label: str = ''#
CircleLabels.name: str = None#
CircleLabels.render_main = False#
CircleLabels.side: str = 'top'#
CircleLabels.size: float = None#
CircleLabels.zorder: int = 0#

Methods#

CircleLabels.data_validator(data, target='2d')#
CircleLabels.get_canvas_size(figure, main_height=None, main_width=None, **kwargs)#

If the size is unknown before rendering, this function must be implemented to return the canvas size in inches.

Return type:

float

CircleLabels.get_data()#
CircleLabels.get_deform_func()#
CircleLabels.get_group_data()#
CircleLabels.get_group_params()#
CircleLabels.get_legends()#

This should define the legend return by the RenderPlan.

The return object could be any matplotlib.artist.Artist

Note

matplotlib.colorbar.Colorbar is not an Artist. Use legendkit.colorart

Return type:

Optional[List[Artist]]

CircleLabels.get_params()#
CircleLabels.get_render_spec(axes)#
CircleLabels.get_split_regroup()#
CircleLabels.reindex_by_chunk(group_data)#
CircleLabels.render(ax)#

This function will be call when render a plot

  • If the canvas is split, render_axes() will be called.

  • If only one ax is passed, render_ax() will be called.

if self.is_split:
    self.render_axes(axes)
else:
    self.render_ax(axes, self.get_render_data())
CircleLabels.render_ax(spec)#

The major rendering function Define how the plot is drawn

Parameters:

spec (RenderSpec)

CircleLabels.set(**kwargs)#
CircleLabels.set_data(*data)#
CircleLabels.set_deform(deform)#
Parameters:

deform (Deformation)

CircleLabels.set_group_data(group_data)#
CircleLabels.set_group_params(group_params)#
Parameters:

group_params (Dict[str, List])

CircleLabels.set_label(label, loc=None, props=None)#
CircleLabels.set_legends(**kwargs)#

Update the options passed to the legend built by get_legends().

Only available on RenderPlan that draws a legend from _legend_kws.

CircleLabels.set_params(params)#
Parameters:

params (Dict[str, List])

CircleLabels.set_side(side)#
CircleLabels.set_size(size)#
CircleLabels.set_split_regroup(ratio)#
CircleLabels.update_main_canvas_size()#