Scatter plot

Points colored by a third variable (c + cmap). edgecolors/ linewidths outline every marker, keeping same-toned points distinguishable where they overlap.

plot 02 scatter

Live figure — pick a tool, then zoom, pan, point-pick or annotate. Nothing is active until a tool is selected.

View this figure’s Vega export ↗ — the raw JSON spec, rendered live by a real Vega engine.

View this figure’s Vega-Lite export ↗ — the raw JSON spec(s), rendered live by a real Vega-Lite engine.

import numpy as np
import plotpress

rng = np.random.default_rng(3)
x = rng.normal(size=300); y = x * 0.5 + rng.normal(size=300)
fig, ax = plotpress.subplots()
ax.scatter(x, y, c=x * x + y * y, cmap="plasma", s=14, alpha=0.85,
          edgecolors="black", linewidths=0.4)
ax.set_title("Scatter"); ax.set_xlabel("x"); ax.set_ylabel("y")
fig.tight_layout()

Total running time of the script: (0 minutes 0.139 seconds)

Gallery generated by Sphinx-Gallery