malariagen_data.af1.Af1.plot_samples_bar#
- Af1.plot_samples_bar(x: str, color: str | None = None, sort: bool = True, sample_sets: Sequence[str] | str | None = None, sample_query: str | None = None, sample_query_options: dict | None = None, template: Literal['ggplot2', 'seaborn', 'simple_white', 'plotly', 'plotly_white', 'plotly_dark', 'presentation', 'xgridoff', 'ygridoff', 'gridon', 'none'] | None = 'plotly_white', width: int | None = 800, height: int | None = 600, show: bool = True, renderer: str | None = None, **kwargs) Figure | None #
Plot a bar chart showing the number of samples available, grouped by some variable such as country or year.
Parameters#
- xstr
Name of sample metadata column to plot on the X axis.
- colorstr or None, optional
Name of the sample metadata column to color bars by.
- sortbool, optional, default: True
If True, sort the bars in size order.
- sample_setssequence of str or str or None, optional
List of sample sets and/or releases. Can also be a single sample set or release.
- sample_querystr or None, optional
A pandas query string to be evaluated against the sample metadata, to select samples to be included in the returned data.
- sample_query_optionsdict or None, optional
A dictionary of arguments that will be passed through to pandas query() or eval(), e.g. parser, engine, local_dict, global_dict, resolvers.
- template{‘ggplot2’, ‘seaborn’, ‘simple_white’, ‘plotly’, ‘plotly_white’, ‘plotly_dark’, ‘presentation’, ‘xgridoff’, ‘ygridoff’, ‘gridon’, ‘none’} or None, optional, default: ‘plotly_white’
The figure template name (must be a key in plotly.io.templates).
- widthint or None, optional, default: 800
Figure width in pixels (px).
- heightint or None, optional, default: 600
Figure height in pixels (px).
- showbool, optional, default: True
If true, show the plot. If False, do not show the plot, but return the figure.
- rendererstr or None, optional
The name of the renderer to use.
- **kwargs
Passed through to px.bar().
Returns#
- Figure or None
A plotly figure (only returned if show=False).