From: Darren D. <dd...@co...> - 2005-02-20 22:05:14
|
I am displaying some images and overlaying a scalebar. The image on the screen displays the requested white text and bar, but they are black in the eps image. text(1,1,'Hi John!',color=1) ---> black text in eps text(1,1,'Hi Jochen!',color='w') ---> black text in eps text(1,1,'I thought this would work...',color=[1,1,1]) ---> black text in eps text(1,1,'but it didnt, so I tried this...',color='y') ---> yellow text in eps text(1,1,'and this...',color=[1,1,0]) ---> yellow text in eps text(1,1,'and finally this.',color=[1,1,.99]) ---> white text in eps I tried to track this through backend_ps.py, where: @ line 103: def set_color(self, r, g, b, store=1): if (r,g,b) != self.color: if r==g and r==b: self._pswriter.write("%1.3f setgray\n"%r) print "%1.3f setgray"%r >>> 1.000 setgray becomes this in the eps file: 0.000 setgray I think there is too much going on behind the scenes for me to follow. This is as far as I could get. -- Darren |
From: John H. <jdh...@ac...> - 2005-02-21 00:58:36
|
>>>>> "Darren" == Darren Dale <dd...@co...> writes: Darren> I am displaying some images and overlaying a scalebar. The Darren> image on the screen displays the requested white text and Darren> bar, but they are black in the eps image. Hi Darren, I'm having trouble replicating the problem. Make sure you have an up-to-date matplotlib. For example, in CVS, I get the expected behavior in agg and ps with from pylab import * subplot(111, axisbg='red') text(0.5, 3.5,'this is black', color=0) text(0.5, 2.5,'this is black', color='k') text(0.5, 1.5,'this is white', color=1) text(0.5, 0.5,'this is white', color='w') axis([0,2,0,4]) savefig('test.ps') show() If you are still having troubles, please submit a complete test script, and the output of --verbose-helpful when you run it. Is it possible you have a pre 0.72 CVS? There were a couple of bugs I introduced into PS CVS before the last release, but I think I cleaned them up. Hope this helps, JDH |
From: Darren D. <dd...@co...> - 2005-02-21 02:59:45
|
Wow, I was going crazy trying to reproduce this. Your script works fine. Try this one: from pylab import * a=rand(100,100) ax=axes() ax.imshow(a) ax.xaxis.set_visible(False) ax.yaxis.set_visible(False) ax.text(10,10,'white',color='w') ax.text(10,20,'black',color='k') savefig('temp.ps') Both the x *and* y axes have to be set_visible(False) to reproduce the behavior. Darren On Sunday 20 February 2005 07:47 pm, John Hunter wrote: > >>>>> "Darren" == Darren Dale <dd...@co...> writes: > > Darren> I am displaying some images and overlaying a scalebar. The > Darren> image on the screen displays the requested white text and > Darren> bar, but they are black in the eps image. > > Hi Darren, > > I'm having trouble replicating the problem. Make sure you have an > up-to-date matplotlib. For example, in CVS, I get the expected > behavior in agg and ps with > > from pylab import * > subplot(111, axisbg='red') > text(0.5, 3.5,'this is black', color=0) > text(0.5, 2.5,'this is black', color='k') > text(0.5, 1.5,'this is white', color=1) > text(0.5, 0.5,'this is white', color='w') > axis([0,2,0,4]) > savefig('test.ps') > show() > > If you are still having troubles, please submit a complete test > script, and the output of --verbose-helpful when you run it. > > Is it possible you have a pre 0.72 CVS? There were a couple of bugs I > introduced into PS CVS before the last release, but I think I cleaned > them up. > > Hope this helps, > JDH > > > ------------------------------------------------------- > SF email is sponsored by - The IT Product Guide > Read honest & candid reviews on hundreds of IT Products from real users. > Discover which products truly live up to the hype. Start reading now. > http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- Darren |
From: John H. <jdh...@ac...> - 2005-02-21 14:34:27
|
>>>>> "Darren" == Darren Dale <dd...@co...> writes: Darren> Wow, I was going crazy trying to reproduce this. Your Darren> script works fine. Try this one: .... Darren> Both the x *and* y axes have to be set_visible(False) to Darren> reproduce the behavior. OK, that helps. Thanks. The problem can be fixed in backend_ps RendererPS.set_color, change the line self.color = (r,g,b) to if store: self.color = (r,g,b) Thanks for the report and example. JDH |