Note
Go to the end to download the full example code.
12.3.10.1.3. Cyberpunk#
This matplotlib style Cyberpunk generate a futuristic style with neon light. In addition to matplotlib, the style must be installed.
pip install mplcyberpunk
import namespaces
import numpy as np
import matplotlib.pyplot as plt
import mplcyberpunk
Generate demo x and y values.
x = np.linspace(0, 10, 20)
y = np.sin(x)
y2 = np.cos(x)
Change matplotlib.pyplot style and plot data.
with plt.style.context(["cyberpunk"]):
plt.figure(figsize=(6, 6))
plt.plot(x, y, marker="o", label="Line 1")
plt.plot(x, y2, marker="x", label="Line 2")
mplcyberpunk.make_lines_glow()
mplcyberpunk.add_gradient_fill(alpha_gradientglow=0.5, gradient_start="zero")
plt.xlabel("X")
plt.ylabel("Y")
plt.grid()
plt.show()
Total running time of the script: (0 minutes 0.403 seconds)