XKCD – Matplotlib 3.8.2-Dokumentation

XKCD – Matplotlib 3.8.2-Dokumentation

Zeigt, wie man einen xkcd-ähnlichen Plot erstellt. import matplotlib.pyplot as plt import numpy as np with plt.xkcd(): # Based on “Stove Ownership” from XKCD by Randall Munroe # https://xkcd.com/418/ fig = plt.figure() ax = fig.add_axes((0.1, 0.2, 0.8, 0.7)) ax.spines[[‘top’, ‘right’]].set_visible(False) ax.set_xticks([]) ax.set_yticks([]) ax.set_ylim([-30, 10]) data = np.ones(100) data[70:] -= np.arange(30) ax.annotate( ‘THE DAY I REALIZEDnI […]