First time here? Check out the FAQ!
answered 7 years ago
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.