Version 3.1.2
matplotlib

Related Topics

Scatter Star PolyΒΆ

Create multiple scatter plots with different star symbols.

Traceback (most recent call last):
  File "/build/matplotlib-tq5J6U/matplotlib-3.1.2/examples/lines_bars_and_markers/scatter_star_poly.py", line 1
    =================
    ^
SyntaxError: invalid syntax
=================
Scatter Star Poly
=================

Create multiple scatter plots with different
star symbols.

"""
import numpy as np
import matplotlib.pyplot as plt

# Fixing random state for reproducibility
np.random.seed(19680801)


x = np.random.rand(10)
y = np.random.rand(10)
z = np.sqrt(x**2 + y**2)

plt.subplot(321)
plt.scatter(x, y, s=80, c=z, marker=">")

plt.subplot(322)
plt.scatter(x, y, s=80, c=z, marker=(5, 0))

verts = np.array([[-1, -1], [1, -1], [1, 1], [-1, -1]])
plt.subplot(323)
plt.scatter(x, y, s=80, c=z, marker=verts)

plt.subplot(324)
plt.scatter(x, y, s=80, c=z, marker=(5, 1))

plt.subplot(325)
plt.scatter(x, y, s=80, c=z, marker='+')

plt.subplot(326)
plt.scatter(x, y, s=80, c=z, marker=(5, 2))

plt.show()

Keywords: matplotlib code example, codex, python plot, pyplot Gallery generated by Sphinx-Gallery