pytutorial/matplotlib/subplot
David Rotermund a48832c327
Add files via upload
Signed-off-by: David Rotermund <54365609+davrot@users.noreply.github.com>
2023-12-22 15:46:11 +01:00
..
image0.png Add files via upload 2023-12-22 15:46:11 +01:00
README.md Create README.md 2023-12-22 15:45:59 +01:00

subplot

{:.no_toc}

* TOC {:toc}

The goal

Questions to David Rotermund

import numpy as np

import matplotlib.pyplot as plt

rng = np.random.default_rng()

plt.figure(1)
plt.subplot(2, 2, 1)
plt.imshow(rng.random((10, 100)))
plt.title("A")
plt.subplot(2, 2, 2)
plt.imshow(rng.random((5, 10)))
plt.title("B")
plt.subplot(2, 2, 3)
plt.imshow(rng.random((50, 20)))
plt.title("C")
plt.subplot(2, 2, 4)
plt.imshow(rng.random((100, 200)))
plt.title("D")
plt.show()

image0