wellmap.Style

class wellmap.Style(*, cell_size: float = 0.25, pad_width: float = 0.2, pad_height: float = 0.2, bar_width: float = 0.15, bar_pad_width: float = 0.2, top_margin: float = 0.5, left_margin: float = 0.5, right_margin: float = 0.2, bottom_margin: float = 0.2, color_scheme: str = 'rainbow', superimpose_values: bool = False, superimpose_format: str = '', superimpose_kwargs: dict = {}, by_param: Dict[str, dict] = {})[source]

Describe how to plot well layouts.

Style objects exist to be passed to show() or show_df(), where they determine various aspects of the plots’ appearances. You can create/modify style objects yourself (see examples below), or you can load them from TOML files via the meta=True argument to load.

Examples

Specify a color scheme (via constructor):

>>> Style(color_scheme='coolwarm')

Specify a color scheme (via attribute):

>>> style = Style()
>>> style.color_scheme = 'coolwarm'

Specify a color scheme for only a specific parameter (via constructor):

>>> Style(by_param={'param': {'color_scheme': 'coolwarm'}})

Specify a color scheme for only a specific parameter (via attribute):

>>> style = Style()
>>> style['param'].color_scheme = 'coolwarm'

Methods

__init__(*[, cell_size, pad_width, ...])

from_merge(*others)

Combine all of the given styles into a single object.

merge(other)

Merge the options from another style object into this one.

Attributes

bar_pad_width

The horizontal padding between the color bar and the nearest layout, in inches.

bar_width

The width of the color bar, in inches.

bottom_margin

The space between the layouts and the bottom edge of the figure, in inches.

cell_size

The size of the boxes representing each well, in inches.

color_scheme

The name of the color scheme to use.

left_margin

The space between the layouts and the left edge of the figure, in inches.

pad_height

The horizontal padding between layouts, in inches.

pad_width

The vertical padding between layouts, in inches.

right_margin

The space between the layouts and the right edge of the figure, in inches.

superimpose_format

The format string to use when superimposing values over each well, e.g.

superimpose_kwargs

Any keyword arguments to pass on to matplotlib.text.Text when rendering the superimposed values over each well.

superimpose_values

Whether or not to write exact values (i.e.

top_margin

The space between the layouts and the top edge of the figure, in inches.


__eq__(other)[source]

Return self==value.

__getitem__(param)[source]

Get the style for a specific parameter.

The following style options can be specified on a per-parameter basis:

This method will return an object that allows getting an setting options specific to the given parameter. Specifically, the object will have an attribute corresponding to each of the above options. If no parameter-specific value has been specified for an option, its value will default to that in the parent Style object.

__init__(*, cell_size: float = 0.25, pad_width: float = 0.2, pad_height: float = 0.2, bar_width: float = 0.15, bar_pad_width: float = 0.2, top_margin: float = 0.5, left_margin: float = 0.5, right_margin: float = 0.2, bottom_margin: float = 0.2, color_scheme: str = 'rainbow', superimpose_values: bool = False, superimpose_format: str = '', superimpose_kwargs: dict = {}, by_param: Dict[str, dict] = {})[source]
__repr__()[source]

Return repr(self).

bar_pad_width: float = 0.2

The horizontal padding between the color bar and the nearest layout, in inches.

bar_width: float = 0.15

The width of the color bar, in inches.

bottom_margin: float = 0.2

The space between the layouts and the bottom edge of the figure, in inches.

cell_size: float = 0.25

The size of the boxes representing each well, in inches.

color_scheme: str = 'rainbow'

The name of the color scheme to use. Each different value for each different parameter will be assigned a color from this scheme. Any name understood by either colorcet or matplotlib can be used.

classmethod from_merge(*others)[source]

Combine all of the given styles into a single object.

If multiple styles specify the same option, the earlier value will be used. The merge for more details.

left_margin: float = 0.5

The space between the layouts and the left edge of the figure, in inches.

merge(other)[source]

Merge the options from another style object into this one.

If both styles specify the same option, for value from this style will be used (i.e. the value won’t change). The superimpose_kwargs option (which is a dictionary) is merged recursively in this same manner.

pad_height: float = 0.2

The horizontal padding between layouts, in inches.

pad_width: float = 0.2

The vertical padding between layouts, in inches.

right_margin: float = 0.2

The space between the layouts and the right edge of the figure, in inches.

superimpose_format: str = ''

The format string to use when superimposing values over each well, e.g.

superimpose_kwargs: dict = None

Any keyword arguments to pass on to matplotlib.text.Text when rendering the superimposed values over each well.

superimpose_values: bool = False

Whether or not to write exact values (i.e. as words/numbers) above each well in the layout. Use True/False to enable/disable this behavior for all parameters, or use a container (e.g. list, set) to enable it only for specific parameter names.

top_margin: float = 0.5

The space between the layouts and the top edge of the figure, in inches.