circle
Draws a circle for each data item. The mark for scatter plots, bubble charts, and dot-based glyphs.
python
from gofish import chart, scatter, circle
chart(catch_locations, axes=True).flow(scatter(by="lake", x="x", y="y")).mark(
circle(r=5)
).render(w=500, h=300)Signature
python
circle(r=None, fill=None, stroke=None, stroke_width=None, debug=None) -> MarkParameters
A circle, drawn as an aspect-locked ellipse. Does NOT support the boxDims positioning channels directly (JS circle() in marks/chart.ts destructures only r/fill/stroke/strokeWidth/opacity) — position it via spread/scatter.
| Option | Type | Default | Description |
|---|---|---|---|
r | int | float | str | Radius; becomes w=h=2r on the underlying ellipse. | |
fill | str | Fill color, or a field name for a color scale. | |
stroke | str | Stroke color. Defaults to fill. | |
stroke_width | float | 0 | Stroke width in pixels. |
opacity | float | 1 | Opacity, 0 to 1, applied to fill and stroke. In JS it may also be a per-datum accessor or a live(...) value; only a literal number crosses the wire. |
debug | bool | Dev-only flag: logs this mark's key and datum to the console as it is built. It changes nothing about what is drawn. |
Returns a Mark for use in .mark(). To attach a text label, chain .label(accessor, ...) on the returned mark rather than passing a label option here.
Examples
python
# Fixed-size dots
chart(data).flow(scatter(x="x", y="y")).mark(circle(r=5))
# Bubble chart — radius encodes a field
chart(data).flow(scatter(x="x", y="y")).mark(circle(r="population", fill="region"))
# Outlined dots
chart(data).flow(scatter(x="x", y="y")).mark(
circle(r=4, fill="white", stroke="black", stroke_width=2)
)