twhoekstra / alpaca_kernel

Jupyter kernel to interact with a MicroPython over the serial REPL. Designed for use with the ALPACA board of the course NB2211 Electronic Instrumentation at the Delft Technical University.
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

matplotlib.pyplot mathtype breaks kernel on MacOS #2

Open twhoekstra opened 2 years ago

twhoekstra commented 2 years ago

Using freetype does not resolve the issue

twhoekstra commented 2 years ago

This code works

%serialconnect --port="/dev/tty.usbmodem14101"
import numpy as np
import matplotlib.pyplot as plt

xx = np.linspace(-5, 5, 50)
f1 = np.sin(xx)
f2 = np.log(xx)

print("Printing something useful...")
plt.plot(xx, f1, label='f_1 = sin(x)')
plt.plot(xx, f2, label='f_2 = log(x)')

print("Printing more useful stuff...")
plt.xlabel('x')
plt.ylabel('y')
plt.title("Two functions plotted")
plt.grid()
plt.legend()

Any mathtext addition breaks the kernel:

%serialconnect --port="/dev/tty.usbmodem14101"
import numpy as np
import matplotlib.pyplot as plt

xx = np.linspace(-5, 5, 50)
f1 = np.sin(xx)
f2 = np.log(xx)

print("Printing something useful...")
plt.plot(xx, f1, label='f_1 = sin(x)')
plt.plot(xx, f2, label='f_2 = log(x)')

print("Printing more useful stuff...")
plt.xlabel('x')
plt.ylabel('$y$')
plt.title("Two functions plotted")
plt.grid()
plt.legend()