_Assay.scatterplot¶
-
_Assay.
scatterplot
(attribute, colorby=None, features=None, title='')¶ Scatter plot for all barcodes.
Requires a 2-D row attribute.
If colorby is None, then this plot can be used to create custom clusters using the plotly lasso tool.
Not selecting any cell deselects all clusters, and double clicking refocuses all points.
- Parameters
- attributestr / np.array
The row attribute to use as coordinates, This row attribute must be 2D. Uses
_Assay.get_attribute()
to retrieve the values constrained by row. The shape must be (#cells, 2).- colorbystr / np.array
The values used to color the scatterplot. Uses
_Assay.get_attribute()
to retrieve the values constrained by row. The shape must be (#cells, *) if 2D, otherwise the shape must be (#cells).- None
The scatterplot is not colored and highlighting using the lasso tool can be used to select subpopulations.
- Any 1D attribute
In case ‘label’ is provided then the stored paltte is used. If the values are strings, then a discrete color map is assumed. For numerical values a continuous color scale is used.
- Any 2D attribute
One dimension must match the number of cells in the assay.
- ‘density’
Colors the plot based on the density of the nearby points.
- featureslist-like
In the case that colorby is a layer then features sets the subset of features to color the plot by.
In the case that colorby is a 2D array features sets the title of each scatterplot. In this case, the length of features must match the number of columns in the colorby 2D array.
- titlestr
The title given to the plot after the name of the assay.
- Returns
- figplotly.graph_objs.FigureWidget
- Raises
- ValueError
Raised when the attribute is not present in the assay or when length of features does not match the second dimension of colorby.