|
| 1 | +# script to generate the pandas logo |
| 2 | + |
| 3 | +from matplotlib import pyplot as plt |
| 4 | +from matplotlib import rcParams |
| 5 | +import numpy as np |
| 6 | + |
| 7 | +rcParams['mathtext.fontset'] = 'cm' |
| 8 | + |
| 9 | + |
| 10 | +def fnx(): |
| 11 | + return np.random.randint(5, 50, 10) |
| 12 | + |
| 13 | + |
| 14 | +fig = plt.figure(figsize=(6, 1.25)) |
| 15 | + |
| 16 | +ax = fig.add_axes((0.45, 0.1, 0.16, 0.8)) |
| 17 | +bar_data = [2.1, -00.8, 1.1, 2.5, -2.1, -0.5, -2.0, 1.5] |
| 18 | +ax.set_ylim(-3, 3) |
| 19 | +ax.set_xticks([]) |
| 20 | +ax.set_yticks([]) |
| 21 | +ax.bar(np.arange(len(bar_data)), bar_data) |
| 22 | + |
| 23 | +ax = fig.add_axes((0.63, 0.1, 0.16, 0.8)) |
| 24 | +for i in range(4): |
| 25 | + ax.plot(np.random.rand(8)) |
| 26 | +ax.set_xticks([]) |
| 27 | +ax.set_yticks([]) |
| 28 | + |
| 29 | +ax = fig.add_axes((0.63 + 0.18, 0.1, 0.16, 0.8)) |
| 30 | +y = np.row_stack((fnx(), fnx(), fnx())) |
| 31 | +x = np.arange(10) |
| 32 | +y1, y2, y3 = fnx(), fnx(), fnx() |
| 33 | +ax.stackplot(x, y1, y2, y3) |
| 34 | +ax.set_xticks([]) |
| 35 | +ax.set_yticks([]) |
| 36 | + |
| 37 | +plt.figtext(0.05, 0.5, "pandas", size=40) |
| 38 | + |
| 39 | +plt.figtext( |
| 40 | + 0.05, 0.2, r"$y_{it} = \beta^{\prime} x_{it} + \mu_{i} + \epsilon_{it}$", |
| 41 | + size=16, color="#5a89a4") |
| 42 | + |
| 43 | +fig.savefig('pandas_logo.svg') |
| 44 | +fig.savefig('pandas_logo.png') |
0 commit comments