Have a look here why Mathcal works in all backends:
http://matplotlib.org/users/mathtext.html
They give an example for an interactive backend which means it would work
with any output format in the link you provided. Could also use \textcolor
for .pdf output as well since the text rendering would use TeX as well but
this wouldn't get you SVG.
On Tue, Aug 13, 2013 at 9:00 PM, Xiha <x...@laposte.net> wrote:
> Hello,
>
> I am trying to color-highlight parts of a figure title. I got it to work
> via the second ('non-interactive') solution given
> here<http://stackoverflow.com/questions/9169052/partial-coloring-of-text-in-matplotlib>,
> using TeX's \textcolor. It has the advantage (over the first solution) that
> you can use .xlabel(), .title() etc. as usual.
>
> However the limitation stated is that it only works when saving the plot
> as a PostScript file. I'm finding this to be true: the coloring does not
> appear when plotting to the screen rather than to a file (as with .show()),
> nor when using matplotlib.use('SVG') or matplotlib.use('AGG') to get svg or
> png output (which I would prefer). This is so even though other 'fancy' TeX
> commands like \mathcal do seem to work in all output options.
>
> I am only minimally acquainted with (La)TeX, and fairly new to Python and
> matplotlib too, so I don't quite grasp what is going on here, and whether
> it is worth digging deeper to try and make it work. So: why is there a
> difference in success between using (e.g.) \mathcal versus \textcolor over
> different output options?
>
> Many thanks!
>
>
> ------------------------------------------------------------------------------
> Get 100% visibility into Java/.NET code with AppDynamics Lite!
> It's a free troubleshooting tool designed for production.
> Get down to code-level detail for bottlenecks, with <2% overhead.
> Download for free and get started troubleshooting in minutes.
> http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk
> _______________________________________________
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>
------------------------------------------------------------------------------
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with <2% overhead.
Download for free and get started troubleshooting in minutes.
http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users