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()
orshow_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 themeta=True
argument toload
.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
The horizontal padding between the color bar and the nearest layout, in inches.
The width of the color bar, in inches.
The space between the layouts and the bottom edge of the figure, in inches.
The size of the boxes representing each well, in inches.
The name of the color scheme to use.
The space between the layouts and the left edge of the figure, in inches.
The horizontal padding between layouts, in inches.
The vertical padding between layouts, in inches.
The space between the layouts and the right edge of the figure, in inches.
The format string to use when superimposing values over each well, e.g.
Any keyword arguments to pass on to
matplotlib.text.Text
when rendering the superimposed values over each well.Whether or not to write exact values (i.e.
The space between the layouts and the top edge of the figure, in inches.
- __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]
- bar_pad_width: float = 0.2
The horizontal padding between the color bar and the nearest layout, in inches.
- bottom_margin: float = 0.2
The space between the layouts and the bottom edge of the figure, 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.
- 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.
- 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.