Open nbecker opened 10 years ago
Can you give an example what you expect (and does not work yet)? something selfcontained... Ideally also an example in plain matplotlib...
Is suspect that we simple have to set a parameter somewhere...
Actually, I haven't tried ggplot2 yet - I'm just looking at it.
I'm referring to e.g.,
plt.title (r'This is a nice title $x^2 = y + 2$')
this is the simple way of using LaTeX in matplotlib strings. There is a more complex and complete way http://matplotlib.org/users/pgf.html
Is this possible with ggplot2?
If that's everything it takes to get latex in the tile, then I think it should be possible via +ggtitle(r'...')
. Usually we just pass the string through.
This works for me:
ggplot(diamonds, aes(x='price', color='cut')) + \
geom_density(fill=True, alpha=0.5) + \
ggtitle(r'This is a nice title $x^2 = y + 2\sin(\pi)$')
The font is different for latex strings, it uses presumably your default tex font (in my case its CM), rather than the ggplot font settings. Otherwise it seems to work fine.
ggplot2 couldn't replace mpl for me without LaTeX support. Any plans for this?