Shapes and text labels¶
Draw on an embedding to mark regions, trace a structure, or name what you see. Shapes are closed outlines and lines are open paths; both are listed in the Shapes panel and stored with the dataset. Text labels are notes placed on the plot. A line can also be used to analyze gene expression along it, which is described in Lines and trajectories.
Where to find it
Add in the toolbar; its arrow opens the menu of tools. Drawn shapes are listed in the Shapes panel below the Cells panel.
The Add menu¶
| Section | Tool | How to draw |
|---|---|---|
| Shape | Lasso | Click and drag; the outline closes itself when you release. |
| Polygon | Click to add vertices, double-click to close. | |
| Line | Pencil | Click and drag to draw freehand. |
| Smooth Curve | Click to add control points, double-click to finish. | |
| Segmented Line | Click to add points, double-click to finish (straight segments). | |
| Text | Text | Click the plot to place a label; click a label to edit it. |
The Add button re-enters the tool you used last. Drawing does not leave the mode, so you can draw several shapes in a row; press Esc to stop. Each new shape is named Line N and appears in the Shapes panel right away. The exception is a shape drawn while the territory tool is waiting for a cut: it becomes that cut and does not enter the Shapes panel (Sections and territories).
Add is a 2D tool; it is hidden while the 3D view is on.
Shapes and lines¶
A shape belongs to the embedding and the pair of columns it was drawn on, and is shown only there. Its points are stored in that embedding's coordinates, so it stays on its cells when you pan and zoom, and it moves with the cells under Adjust (rotate, flip, Quilt).
The Shapes panel¶
Each row in the Shapes panel has:
- a checkbox that includes the line in a multi-line analysis (Lines and trajectories),
- the name (double-click to rename; hover to see which embedding it is on); a
~after it means the line has been smoothed, - the number of cells projected onto it,
- ⚙ line tools: smoothing, appearance, and the analysis tools,
- + to project the selected cells onto the line,
- a visibility toggle, and a delete button, which also removes the line's projections.
Smoothing¶
Under ⚙ → Smoothing, Smooth replaces the line's path with a moving average of its points. Window (odd, 3 to 21, default 5) is the number of neighboring points averaged; Iterations (1 to 10, default 2) is how many passes are made. The original points are kept, and analyses use the smoothed path when there is one. The defaults come from line_smoothing: in the configuration (Configure defaults).
Appearance¶
Under ⚙ → Appearance:
| Setting | Default | What it does |
|---|---|---|
| Color | #4ecdc4 |
Stroke color. |
| Width | 2 | Stroke width, 1 to 10. |
| Fill | off | Fill the inside of the shape; when on, pick a fill color (it starts as the stroke color). |
| Closed | on for Lasso and Polygon | Join the last point to the first. |
The rest of the ⚙ panel (Projections, Gene Association, Projection Embedding) is covered in Lines and trajectories.
Text labels¶
- Choose Add → Text.
- Click the plot where the label should go. An editor opens.
- Type the text. Shift+Enter starts a new line; Enter adds the label.
- Click any label later to edit it, or drag it to move it.
The editor has:
| Control | Default | What it does |
|---|---|---|
| Text | Multi-line text. | |
| Size | 14 | Font size in screen pixels, 6 to 96. |
| Color | white | Text color. |
| B, I | off | Bold and italic. |
| Align | centered | Left-aligned (text starts at the point), centered on the point, or right-aligned (text ends at the point). |
| Rotate | 0° | Rotation in degrees clockwise, −180 to 180 in steps of 5. |
| Box | off | A background box behind the text, with its own color (black to start) and Opacity (default 0.6). |
Done (or Enter) keeps the edits; Revert (or Esc) undoes the edits made since the editor opened. Delete removes the label, as does Del or Backspace when the cursor is not in a text field. A new label starts with the style of the last one you placed.
A label is anchored in the embedding's data coordinates, while its size is in screen pixels. It stays on its cells under pan, zoom, rotate, flip and Quilt, and stays upright when the embedding rotates. Like a shape, it is shown only on the embedding and column pair it was placed on. Labels are drawn in embedding snapshots and, read-only, in every panel of a Panels figure.
Where they are stored¶
Shapes and labels are saved in the dataset, each as one JSON string:
| Where | What |
|---|---|
uns['skopia_lines_json'] |
Every shape and line: name, embedding and axes, points, smoothed points, draw type, closed, visibility, stroke and fill. |
uns['skopia_text_annotations_json'] |
Every text label: text, position, embedding and axes, style. |
Changes are sent to the backend as you make them, so a browser reload keeps them, and they are written into the .h5ad when you save or export. Reopening that file restores them.
Deleting a subset can delete shapes and labels
When you delete a named subset together with its results, its embeddings go, and with them every shape and text label drawn on those embeddings. The confirmation lists how many shapes will be removed.