marsilea.plotter.base.RenderPlan#

class RenderPlan#

Bases: object

The base class for every plotter in Marsilea

Attributes:
namestr

The name of the plot, can be used to retrieve the render axes and corresponding legend.

sidestr, default: ‘top’

Which side to render this plot

sizefloat
allow_splitbool, default: True

Use to mark if the RenderPlan can be split

render_mainbool, default: False

Use to mark if the RenderPlan can be rendered on main canvas

zorderint, default: 0

This only works if the RenderPlan is rendered on main canvas

allow_labeling = True#
allow_split = True#
data_validator(data, target='2d')#
deform = None#
get_canvas_size(figure)#

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.

The return object could be any matplotlib.artist.Artist

get_params()#
get_render_spec(axes)#
get_split_regroup()#
property has_deform#

If the RenderPlan has Deformation

property is_body#

Draw on top and bottom

property is_flank#

Draw on left and right

property is_split#

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

label = ''#
name = None#
reindex_by_chunk(group_data)#
render(axes)#

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())
render_ax(spec)#

The major rendering function Define how the plot is drawn

render_main = False#
set(**kwargs)#
set_data(*data)#
set_deform(deform)#
set_group_data(group_data)#
set_group_params(group_params)#
set_label(label, loc=None, props=None)#
set_legends(*args, **kwargs)#
set_params(params)#
set_side(side)#
set_size(size)#
set_split_regroup(ratio)#
side = 'top'#
size = None#
update_main_canvas_size()#
zorder = 0#