First time here? Check out the FAQ!
answered 2018-03-11 02:59:21 +0100
The secret sauce is that you can ask legend_label to use the LaTeX representation of the function like so:
legend_label
p1=plot(y1, (t,-5,5), gridlines=True,color='red', legend_label='$'+latex(y1)+'$')
See this live example.