1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
|
"""
Using Unicode everywhere π€
===========================
This example demonstrates how to include non-ASCII characters, mostly emoji π
to stress test the build and test environments that parse the example files.
"""
# π π
# Code source: Γscar NΓ‘jera
# License: BSD 3 clause
import matplotlib.pyplot as plt
import numpy as np
plt.rcParams["font.size"] = 20
plt.rcParams["font.monospace"] = ["DejaVu Sans Mono"]
plt.rcParams["font.family"] = "monospace"
plt.figure()
x = np.random.randn(100) * 2 + 1
y = np.random.randn(100) * 6 + 3
s = np.random.rand(*x.shape) * 800 + 500
plt.scatter(x, y, s, marker=r"$\oint$")
x = np.random.randn(60) * 7 - 4
y = np.random.randn(60) * 3 - 2
s = s[: x.size]
plt.scatter(x, y, s, alpha=0.5, c="g", marker=r"$\clubsuit$")
plt.xlabel("β")
plt.ylabel("β")
plt.title("β²" * 10)
print("Std out capture π")
# To avoid matplotlib text output
plt.show()
# %%
# Debug fonts
print(plt.rcParams)
|