Skip to content

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) -> Mark

Parameters ​

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.

OptionTypeDefaultDescription
rint | float | strRadius; becomes w=h=2r on the underlying ellipse.
fillstrFill color, or a field name for a color scale.
strokestrStroke color. Defaults to fill.
stroke_widthfloat0Stroke width in pixels.
opacityfloat1Opacity, 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.
debugboolDev-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)
)