Skip to content
Internals

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).flow(scatter(by="lake", x="x", y="y")).mark(
    circle(r=5)
).render(w=500, h=300, axes=True)

Signature

python
circle(r=None, fill=None, stroke=None, strokeWidth=None, opacity=None,
       label=None, debug=None) -> Mark

Parameters

ParameterTypeDescription
rint | strRadius — a constant or a field name
fillstrFill color — a constant or a field name
strokestrStroke color
strokeWidthintStroke width in pixels
opacityfloatOpacity, 01
labelbool | strWhether/what to label the circle

Returns a Mark for use in .mark().

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", strokeWidth=2)
)