On Friday, May 6, 2016 at 11:38:20 AM UTC-4, Tom Breloff wrote:
>
> Just use string interpolation (this is a Julia thing, not specific to 
> PyPlot).
>
> title("\pi = $pi")
>
>
To get Matplotlib to use LaTeX for π, you need (escaped) dollar signs and 
also to escape the backslash: title("\$\\pi\$ = $pi").  Or you can use 
Unicode for \pi: title("π = $pi").

Note that string(pi) is "π = 3.1415926535897...", however, so for this 
particular example you probably want
    title("π ≈ $(Float64(pi))")

Reply via email to