Note
Click here to download the full example code
Creating a custom ellipse symbol in scatter plot.
Traceback (most recent call last):
File "/build/matplotlib-xz4j8t/matplotlib-3.1.2/examples/lines_bars_and_markers/scatter_custom_symbol.py", line 1
=====================
^
SyntaxError: invalid syntax
=====================
Scatter Custom Symbol
=====================
Creating a custom ellipse symbol in scatter plot.
"""
import matplotlib.pyplot as plt
import numpy as np
# unit area ellipse
rx, ry = 3., 1.
area = rx * ry * np.pi
theta = np.arange(0, 2 * np.pi + 0.01, 0.1)
verts = np.column_stack([rx / area * np.cos(theta), ry / area * np.sin(theta)])
x, y, s, c = np.random.rand(4, 30)
s *= 10**2.
fig, ax = plt.subplots()
ax.scatter(x, y, s, c, marker=verts)
plt.show()
Keywords: matplotlib code example, codex, python plot, pyplot Gallery generated by Sphinx-Gallery