I’m trying to add legends using Latex as follows:
using PyPlot
m = 100
xx = collect(linspace(-1.0, 1.0, 100))
yy = sin(m*xx)
zz = collect(linspace(-5, 3.0, 100))
figure(1)
clf()
h1, h2 = plot(xx, yy, "b.", xx, zz, "r+")
legend((h1, h2), (L"$\sin( $m x)$", L"Linear"))
I’m trying to print the value of m in the legend, but don’t know how to and can’t find any examples. Could anyone give me a hint?