How to get Sage 8.0 to plot matplotlib plots inline and typeset expressions on a Jupyter notebook?
If I start Sage 8.0 notebook using the jupyter notebook (sage -n jupyter
), and the following code:
from numpy import arange, sin, pi
import matplotlib.pyplot as plt
X = arange(0.0, 2*pi, 0.01)
plt.plot(X, sin(X))
plt.show()
x + 1
The plot displays inline but the expression $x+1$ is not typeset.
If I run the following code:
%display typeset
from numpy import arange, sin, pi
import matplotlib.pyplot as plt
X = arange(0.0, 2*pi, 0.01)
plt.plot(X, sin(X))
plt.show()
x + 1
Then, the plot does not display inline. It shows:
π΅πππππ(πΊπΉπΈπ‘πΈπΎπΎ)
However, the expression $x+1$ is in typeset.
How can I have both the matplotlib plots display inline and expressions typeset?