import numpy as np
import matplotlib.pyplot as plt
= np.arange(0, 2, 0.01)
r = 2 * np.pi * r
theta = plt.subplots(subplot_kw={'projection': 'polar'})
fig, ax
ax.plot(theta, r)0.5, 1, 1.5, 2])
ax.set_rticks([True)
ax.grid( plt.show()
Jupyter Notebook
Demonstration of including a Jupyter Notebook file
Jupyter Notebook files
You can create content with Jupyter notebooks.
A plot
Interactive outputs
Below we’ll display a map using folium. When your book is built, the code for creating the interactive map is retained.
import folium
= folium.Map(
m =[45.372, -121.6972],
location=12,
zoom_start='Stamen Terrain',
tiles='<a href=https://maps.stamen.com/terrain/Stamen Terrain</a>'
attr
)
folium.Marker(=[45.3288, -121.6625],
location='Mt. Hood Meadows',
popup=folium.Icon(icon='cloud')
icon
).add_to(m)
folium.Marker(=[45.3311, -121.7113],
location='Timberline Lodge',
popup=folium.Icon(color='green')
icon
).add_to(m)
folium.Marker(=[45.3300, -121.6823],
location='Some Other Location',
popup=folium.Icon(color='red', icon='info-sign')
icon
).add_to(m)
m
Make this Notebook Trusted to load map: File -> Trust Notebook