I have a jupyter notebook which I am converting to a slideshow using:
jupyter nbconvert notebook.ipynb --to slides --post serve --SlidesExporter.reveal_scroll=True
Some of the slides contain a code segment with a figure as output. At the moment the figure runs off the bottom of the screen. Since this is the main purpose of the slide is there a way to either enable scrolling (I thought --SlidesExporter.reveal_scroll=True should do this, but it doesn't work in my case - no scroll bar appears). Or is there a way to split the input and output across two slides or to hide the input code and just show the output figure.
An example of the code cell which is too long is below:
import numpy as np
import matplotlib.pyplot as plt
t=np.linspace(0,1,1000)
Sr=np.exp(1j*t*(15)*2*np.pi)* np.exp(-5 *t)
#Trial wavefunctions
#Frequency (Hz)
f=[5,10,15,20]
y=np.cos(f[0]*2*np.pi*t)
#Multiply the signal with our trial cosine function
S_cos = np.real(Sr)*y
#Integrate the signal (using Simpson's rule for numerical integration)
from scipy.integrate import simps
area=np.empty([4,])
area[0] = simps(S_cos,dx=1)
print('Area under product function = %.1f' %area[0])
#Plot the real part of the signal
plt.figure(figsize=(14,6))
plt.subplot(1,2,1)
plt.plot(t,np.real(Sr),label='Signal')
plt.plot(t,y,label='Trial cosine')
plt.xlabel('Time (s)')
plt.ylabel('Intensity')
plt.legend()
plt.subplot(1,2,2)
plt.plot(t,S_cos, 'g', label='Product (signal*trial cosine)')
plt.xlabel('Time (s)')
plt.ylabel('Intensity')
plt.legend()
plt.show()