[julia-users] PyPlot and Latex labels using a variable

2015-12-15 Thread Štěpán Starosta
Hi, this works for me using PyPlot imshow([1 1]) title(L"\frac{1}{2}") I get the latex compiled. I want to print a label in latex based on a variable, i.e., something like this s = "\frac{1}{2}" title(L"$s") but I end up with "$s" printed in the image. I'd be grateful for any advice.

Re: [julia-users] PyPlot and Latex labels using a variable

2015-12-15 Thread Mauro
`latexstring` is what you're looking for. Have a look at the readme of https://github.com/stevengj/LaTeXStrings.jl Example: latexstring("an equation: \$1 + \\alpha^2\$") On Tue, 2015-12-15 at 14:26, Štěpán Starosta wrote: > Hi, > > this works for me > > using PyPlot

Re: [julia-users] PyPlot and Latex labels using a variable

2015-12-15 Thread Yichao Yu
On Tue, Dec 15, 2015 at 2:59 PM, Mauro wrote: > `latexstring` is what you're looking for. Have a look at the readme of > https://github.com/stevengj/LaTeXStrings.jl > > Example: > > latexstring("an equation: \$1 + \\alpha^2\$") I think for PyPlot it works equally well

Re: [julia-users] PyPlot and Latex labels using a variable

2015-12-15 Thread Mauro
On Tue, 2015-12-15 at 22:00, Yichao Yu wrote: > On Tue, Dec 15, 2015 at 3:54 PM, Mauro wrote: Example: latexstring("an equation: \$1 + \\alpha^2\$") >>> >>> I think for PyPlot it works equally well without `latexstring` since >>> pyplot

Re: [julia-users] PyPlot and Latex labels using a variable

2015-12-15 Thread Mauro
>> Example: >> >> latexstring("an equation: \$1 + \\alpha^2\$") > > I think for PyPlot it works equally well without `latexstring` since > pyplot will handle that directly. Sorry that was a bad example without interpolation. But the original example needs latexstring, no? julia> s =

Re: [julia-users] PyPlot and Latex labels using a variable

2015-12-15 Thread Yichao Yu
On Tue, Dec 15, 2015 at 3:54 PM, Mauro wrote: >>> Example: >>> >>> latexstring("an equation: \$1 + \\alpha^2\$") >> >> I think for PyPlot it works equally well without `latexstring` since >> pyplot will handle that directly. > > Sorry that was a bad example without

Re: [julia-users] PyPlot and Latex labels using a variable

2015-12-15 Thread Yichao Yu
On Tue, Dec 15, 2015 at 4:13 PM, Mauro wrote: > > On Tue, 2015-12-15 at 22:00, Yichao Yu wrote: >> On Tue, Dec 15, 2015 at 3:54 PM, Mauro wrote: > Example: > > latexstring("an equation: \$1 + \\alpha^2\$") I