mirror of
https://github.com/wahyd4/code-sandbox.git
synced 2026-08-09 05:07:03 +10:00
14 lines
285 B
Python
14 lines
285 B
Python
import matplotlib.pyplot as plt
|
|
import numpy as np
|
|
|
|
rng = np.random.RandomState(0)
|
|
x = rng.randn(100)
|
|
y = rng.randn(100)
|
|
colors = rng.rand(100)
|
|
sizes = 1000 * rng.rand(100)
|
|
|
|
plt.scatter(x, y, c=colors, s=sizes, alpha=0.5, cmap="viridis")
|
|
plt.colorbar() # show color scale
|
|
|
|
plt.show()
|