markdown | alt strategy#

In this page, both the code and the markdown cells have images. The markdown and alt strategy is used to display the images in the gallery.

Conventional markdown syntax#

![](/_static/intersecting_planes.png)

Image directive#

```{image} /_static/bar_colors.png
   :align: center
   :alt: gallery_thumbnail
```
gallery_thumbnail

Figure directive#

```{figure} /_static/heatmap.png
   :align: center
   :alt: random text
```
random text
import matplotlib.pyplot as plt
import numpy as np

# Fixing random state for reproducibility
np.random.seed(19680801)

# Compute pie slices
N = 20
theta = np.linspace(0.0, 2 * np.pi, N, endpoint=False)
radii = 10 * np.random.rand(N)
width = np.pi / 4 * np.random.rand(N)
colors = plt.cm.viridis(radii / 10.0)

ax = plt.subplot(projection="polar")
ax.bar(theta, radii, width=width, bottom=0.0, color=colors, alpha=0.5)

plt.show()
../../_images/db22906f2817f4c77fa6eb8816d8f1caf03c8ac41de6fdf855ab38a4c6d5b8df.png
# Fixing random state for reproducibility
np.random.seed(19680801)

# Compute areas and colors
N = 150
r = 2 * np.random.rand(N)
theta = 2 * np.pi * np.random.rand(N)
area = 200 * r**2
colors = theta

fig = plt.figure()
ax = fig.add_subplot(projection="polar")
c = ax.scatter(theta, r, c=colors, s=area, cmap="hsv", alpha=0.75)
../../_images/f7102609076557fdb7c88d0c447c6e802ec424b0105d6a47d0dfbe7273ba9828.png