[matplotlib-devel] Issue with colored latex text on plots
Hi,
I'm trying to generate colored text on my plots, but can only seem
to get black and white. I've attached an example python scriptx
(test.py) that demonstrates the problem. This produces a plot
(test.png) with black and white text even though I've explicitly told
latex to use color, and in fact the intermediate image gets colored
correctly (attached 25a9904ac88febf5f01477f069213537.png file taken
from .matplotlib/tex.cache). I'm currently using matplotlib 0.99.3.
Thanks for any help with this issue.
Note that I'm not subscribed to this list, so please CC me on replies.
Best wishes,
Mike
#!/usr/bin/python
import numpy , pylab
x = numpy.arange( 0.0 , 5.0 )
pylab.rc( 'text' , usetex=True )
pylab.rc( 'text.latex' , preamble='\usepackage[usenames]{color}' )
pylab.title( '\\textcolor{Blue}{colored title wanted}' )
pylab.plot( x )
pylab.savefig( 'test.png' )
<><>--
Special Offer -- Download ArcSight Logger for FREE!
Finally, a world-class log management solution at an even better
price-free! And you'll get a free "Love Thy Logs" t-shirt when you
download Logger. Secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsisghtdev2dev___
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel
Re: [matplotlib-devel] Issue with colored latex text on plots
John Hunter wrote:
> On Wed, Aug 31, 2011 at 8:49 PM, John Hunter wrote:
>
> >> Note that I'm not subscribed to this list, so please CC me on replies.
> >
> > That won't work because mpl converts all tex png raster to black and
> > white and handles color on its own in post-processing. The following
> > does work:
[...]
> But since you set usetex, you shouldn't need the $ escapes and the
> literal rm font. It should be enough to do:
>
> pylab.title( r'colored title wanted 2.5', color='blue' )\
Hi,
Thanks for the insight. What I'm really trying to get is multiple
colors in the title text. For example, if mpl didn't convert all text
to black, I would want the following to produce blue and red text:
pylab.rc( 'text' , usetex=True )
pylab.rc( 'text.latex' , preamble='\usepackage[usenames]{color}' )
pylab.title( '\\textcolor{Blue}{blue part} \\textcolor{Red}{red part}')
Is there a particular reason why mpl has to convert png colored text
to black and white?
Best wishes,
Mike
--
Special Offer -- Download ArcSight Logger for FREE!
Finally, a world-class log management solution at an even better
price-free! And you'll get a free "Love Thy Logs" t-shirt when you
download Logger. Secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsisghtdev2dev
___
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel
[matplotlib-devel] Unavoidable gridlines in pcolor pdf output
Hi, It seems that savig a pcolor plot to a pdf format always includes gridlines, which isn't true for other output formats like png. The attached example demonstrates this problem. I've only tested this on version 1.1.1rc1. Thanks, Mike test Description: Binary data -- For Developers, A Lot Can Happen In A Second. Boundary is the first to Know...and Tell You. Monitor Your Applications in Ultra-Fine Resolution. Try it FREE! http://p.sf.net/sfu/Boundary-d2dvs2___ Matplotlib-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/matplotlib-devel
Re: [matplotlib-devel] Unavoidable gridlines in pcolor pdf output
On Mon, Apr 9, 2012 at 1:43 PM, Eric Firing wrote: >> Making the polygons overlap by one pdf unit (1/72 of an inch) seems to >> make the lines go away at least in Preview. Making them overlap by 0.1 >> units does not help. > > Does it make them go away with alpha = 0.5, say? Setting alpha 0.5 didn't help. It made the contours more transparent as expected, but the unwanted lines remain yet with the same amount of transparency. Best wishes, Mike -- For Developers, A Lot Can Happen In A Second. Boundary is the first to Know...and Tell You. Monitor Your Applications in Ultra-Fine Resolution. Try it FREE! http://p.sf.net/sfu/Boundary-d2dvs2 ___ Matplotlib-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/matplotlib-devel
