From: Samuel M. S. <sm...@sa...> - 2006-11-21 19:14:04
|
I recently upgraded matplotlib 87.7 Mac OS X PPC 10.4 python 2.4 from sourceforge binary Using backend TkAgg version 8.4 Whenever I save png plots using the toolbar save button or explicitly, the edgecolor around the outside of the plot is gray. I want it to be white. I have the following in my rc file. savefig.edgecolor : white # figure edgecolor when saving I also tried this in my plotting program rc('savefig',edgecolor = 'w') and I also tried saving from the plotting program with savefig("paths4test.png",edgecolor= 'w') Nothing seems to work. I didn't have this problem with Matplotlib 85.x ********************************************************************** Samuel M. Smith Ph.D. 2966 Fort Hill Road Eagle Mountain, Utah 84005-4108 801-768-2768 voice 801-768-2769 fax ********************************************************************** "The greatest source of failure and unhappiness in the world is giving up what we want most for what we want at the moment" ********************************************************************** |
From: Samuel M. S. <sm...@sa...> - 2006-11-21 19:21:34
|
It also doesn't work with backend WXAgg version 2.6.3.3 On 21 Nov, 2006, at 12:13, Samuel M. Smith wrote: > I recently upgraded matplotlib 87.7 Mac OS X PPC 10.4 python 2.4 from > sourceforge binary > Using backend TkAgg version 8.4 > > > Whenever I save png plots using the toolbar save button or explicitly, > the edgecolor around the outside of the plot is gray. I want it to > be white. > > I have the following in my rc file. > savefig.edgecolor : white # figure edgecolor when saving > > I also tried this in my plotting program > rc('savefig',edgecolor = 'w') > > and I also tried saving from the plotting program with > savefig("paths4test.png",edgecolor= 'w') > > Nothing seems to work. > > I didn't have this problem with Matplotlib 85.x > > > > ********************************************************************** > Samuel M. Smith Ph.D. > 2966 Fort Hill Road > Eagle Mountain, Utah 84005-4108 > 801-768-2768 voice > 801-768-2769 fax > ********************************************************************** > "The greatest source of failure and unhappiness in the world is > giving up what we want most for what we want at the moment" > ********************************************************************** > > > > ---------------------------------------------------------------------- > --- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to > share your > opinions on IT & business topics through brief surveys - and earn cash > http://www.techsay.com/default.php? > page=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users ********************************************************************** Samuel M. Smith Ph.D. 2966 Fort Hill Road Eagle Mountain, Utah 84005-4108 801-768-2768 voice 801-768-2769 fax ********************************************************************** "The greatest source of failure and unhappiness in the world is giving up what we want most for what we want at the moment" ********************************************************************** |
From: John H. <jdh...@ac...> - 2006-11-21 19:21:35
|
>>>>> "Samuel" == Samuel M Smith <sm...@sa...> writes: Samuel> I recently upgraded matplotlib 87.7 Mac OS X PPC 10.4 Samuel> python 2.4 from sourceforge binary Using backend TkAgg Samuel> version 8.4 Samuel> Whenever I save png plots using the toolbar save button or Samuel> explicitly, the edgecolor around the outside of the plot Samuel> is gray. I want it to be white. Samuel> I have the following in my rc file. savefig.edgecolor : Samuel> white # figure edgecolor when saving Samuel> I also tried this in my plotting program Samuel> rc('savefig',edgecolor = 'w') Samuel> and I also tried saving from the plotting program with Samuel> savefig("paths4test.png",edgecolor= 'w') Strange -- I don't see that. In the example below, the rows of [1,1,1,1] indicate white. What do you get? In [5]: plot([1,2,3]) Out[5]: [<matplotlib.lines.Line2D instance at 0xb64dd74c>] In [6]: savefig('test.png') In [7]: im = imread('test.png') In [8]: im.shape Out[8]: (900, 1200, 4) In [10]: im[0:5,0:10,:] Out[10]: array([[[ 1., 1., 1., 1.], [ 1., 1., 1., 1.], [ 1., 1., 1., 1.], [ 1., 1., 1., 1.], [ 1., 1., 1., 1.], [ 1., 1., 1., 1.], [ 1., 1., 1., 1.], [ 1., 1., 1., 1.], [ 1., 1., 1., 1.], [ 1., 1., 1., 1.]], [[ 1., 1., 1., 1.], [ 1., 1., 1., 1.], [ 1., 1., 1., 1.], [ 1., 1., 1., 1.], [ 1., 1., 1., 1.], [ 1., 1., 1., 1.], [ 1., 1., 1., 1.], [ 1., 1., 1., 1.], [ 1., 1., 1., 1.], [ 1., 1., 1., 1.]], [[ 1., 1., 1., 1.], [ 1., 1., 1., 1.], [ 1., 1., 1., 1.], [ 1., 1., 1., 1.], [ 1., 1., 1., 1.], [ 1., 1., 1., 1.], [ 1., 1., 1., 1.], [ 1., 1., 1., 1.], [ 1., 1., 1., 1.], [ 1., 1., 1., 1.]], [[ 1., 1., 1., 1.], [ 1., 1., 1., 1.], [ 1., 1., 1., 1.], [ 1., 1., 1., 1.], [ 1., 1., 1., 1.], [ 1., 1., 1., 1.], [ 1., 1., 1., 1.], [ 1., 1., 1., 1.], [ 1., 1., 1., 1.], [ 1., 1., 1., 1.]], [[ 1., 1., 1., 1.], [ 1., 1., 1., 1.], [ 1., 1., 1., 1.], [ 1., 1., 1., 1.], [ 1., 1., 1., 1.], [ 1., 1., 1., 1.], [ 1., 1., 1., 1.], [ 1., 1., 1., 1.], [ 1., 1., 1., 1.], [ 1., 1., 1., 1.]]], dtype=float32) |
From: John H. <jdh...@ac...> - 2006-11-21 19:26:41
|
>>>>> "John" == John Hunter <jdh...@ac...> writes: John> Strange -- I don't see that. In the example below, the rows John> of [1,1,1,1] indicate white. What do you get? And when I ask for red, I get that too: In [1]: plot([1,2,3]) Out[1]: [<matplotlib.lines.Line2D instance at 0xb64c7f6c>] In [2]: savefig('test.png', edgecolor='red') In [3]: im = imread('test.png') In [4]: im[0:5,0:10,:] Out[4]: array([[[ 1. , 0. , 0. , 1. ], [ 1. , 0. , 0. , 1. ], [ 1. , 0. , 0. , 1. ], [ 1. , 0. , 0. , 1. ], [ 1. , 0. , 0. , 1. ], [ 1. , 0. , 0. , 1. ], [ 1. , 0. , 0. , 1. ], [ 1. , 0. , 0. , 1. ], [ 1. , 0. , 0. , 1. ], [ 1. , 0. , 0. , 1. ]], [[ 1. , 0. , 0. , 1. ], [ 1. , 0. , 0. , 1. ], [ 1. , 0.45882353, 0.45882353, 1. ], [ 1. , 0.45882353, 0.45882353, 1. ], [ 1. , 0.45882353, 0.45882353, 1. ], [ 1. , 0.45882353, 0.45882353, 1. ], [ 1. , 0.45882353, 0.45882353, 1. ], [ 1. , 0.45882353, 0.45882353, 1. ], [ 1. , 0.45882353, 0.45882353, 1. ], [ 1. , 0.45882353, 0.45882353, 1. ]], [[ 1. , 0. , 0. , 1. ], [ 1. , 0.45882353, 0.45882353, 1. ], [ 1. , 1. , 1. , 1. ], [ 1. , 1. , 1. , 1. ], [ 1. , 1. , 1. , 1. ], [ 1. , 1. , 1. , 1. ], [ 1. , 1. , 1. , 1. ], [ 1. , 1. , 1. , 1. ], [ 1. , 1. , 1. , 1. ], [ 1. , 1. , 1. , 1. ]], [[ 1. , 0. , 0. , 1. ], [ 1. , 0.45882353, 0.45882353, 1. ], [ 1. , 1. , 1. , 1. ], [ 1. , 1. , 1. , 1. ], [ 1. , 1. , 1. , 1. ], [ 1. , 1. , 1. , 1. ], [ 1. , 1. , 1. , 1. ], [ 1. , 1. , 1. , 1. ], [ 1. , 1. , 1. , 1. ], [ 1. , 1. , 1. , 1. ]], [[ 1. , 0. , 0. , 1. ], [ 1. , 0.45882353, 0.45882353, 1. ], [ 1. , 1. , 1. , 1. ], [ 1. , 1. , 1. , 1. ], [ 1. , 1. , 1. , 1. ], [ 1. , 1. , 1. , 1. ], [ 1. , 1. , 1. , 1. ], [ 1. , 1. , 1. , 1. ], [ 1. , 1. , 1. , 1. ], [ 1. , 1. , 1. , 1. ]]], dtype=float32) |
From: Samuel M. S. <sm...@sa...> - 2006-11-21 19:27:18
|
I figured it out. It is saving the outside edge as transparent not gray. I was viewing the images in Apple's preview and it displays transparent as gray (not checkerboard like photoshop or graphic converter). Sorry. On 21 Nov, 2006, at 12:21, John Hunter wrote: >>>>>> "Samuel" == Samuel M Smith <sm...@sa...> writes: > > Samuel> I recently upgraded matplotlib 87.7 Mac OS X PPC 10.4 > Samuel> python 2.4 from sourceforge binary Using backend TkAgg > Samuel> version 8.4 > > > Samuel> Whenever I save png plots using the toolbar save button or > Samuel> explicitly, the edgecolor around the outside of the plot > Samuel> is gray. I want it to be white. > > Samuel> I have the following in my rc file. savefig.edgecolor : > Samuel> white # figure edgecolor when saving > > Samuel> I also tried this in my plotting program > Samuel> rc('savefig',edgecolor = 'w') > > Samuel> and I also tried saving from the plotting program with > Samuel> savefig("paths4test.png",edgecolor= 'w') > > Strange -- I don't see that. In the example below, the rows of > [1,1,1,1] indicate white. What do you get? > > > In [5]: plot([1,2,3]) > Out[5]: [<matplotlib.lines.Line2D instance at 0xb64dd74c>] > > In [6]: savefig('test.png') > > In [7]: im = imread('test.png') > > In [8]: im.shape > Out[8]: (900, 1200, 4) > > > In [10]: im[0:5,0:10,:] > Out[10]: > array([[[ 1., 1., 1., 1.], > [ 1., 1., 1., 1.], > [ 1., 1., 1., 1.], > [ 1., 1., 1., 1.], > [ 1., 1., 1., 1.], > [ 1., 1., 1., 1.], > [ 1., 1., 1., 1.], > [ 1., 1., 1., 1.], > [ 1., 1., 1., 1.], > [ 1., 1., 1., 1.]], > > [[ 1., 1., 1., 1.], > [ 1., 1., 1., 1.], > [ 1., 1., 1., 1.], > [ 1., 1., 1., 1.], > [ 1., 1., 1., 1.], > [ 1., 1., 1., 1.], > [ 1., 1., 1., 1.], > [ 1., 1., 1., 1.], > [ 1., 1., 1., 1.], > [ 1., 1., 1., 1.]], > > [[ 1., 1., 1., 1.], > [ 1., 1., 1., 1.], > [ 1., 1., 1., 1.], > [ 1., 1., 1., 1.], > [ 1., 1., 1., 1.], > [ 1., 1., 1., 1.], > [ 1., 1., 1., 1.], > [ 1., 1., 1., 1.], > [ 1., 1., 1., 1.], > [ 1., 1., 1., 1.]], > > [[ 1., 1., 1., 1.], > [ 1., 1., 1., 1.], > [ 1., 1., 1., 1.], > [ 1., 1., 1., 1.], > [ 1., 1., 1., 1.], > [ 1., 1., 1., 1.], > [ 1., 1., 1., 1.], > [ 1., 1., 1., 1.], > [ 1., 1., 1., 1.], > [ 1., 1., 1., 1.]], > > [[ 1., 1., 1., 1.], > [ 1., 1., 1., 1.], > [ 1., 1., 1., 1.], > [ 1., 1., 1., 1.], > [ 1., 1., 1., 1.], > [ 1., 1., 1., 1.], > [ 1., 1., 1., 1.], > [ 1., 1., 1., 1.], > [ 1., 1., 1., 1.], > [ 1., 1., 1., 1.]]], dtype=float32) > > ********************************************************************** Samuel M. Smith Ph.D. 2966 Fort Hill Road Eagle Mountain, Utah 84005-4108 801-768-2768 voice 801-768-2769 fax ********************************************************************** "The greatest source of failure and unhappiness in the world is giving up what we want most for what we want at the moment" ********************************************************************** |
From: John H. <jdh...@ac...> - 2006-11-21 19:29:32
|
>>>>> "Samuel" == Samuel M Smith <sm...@sa...> writes: Samuel> I figured it out. It is saving the outside edge as Samuel> transparent not gray. I was viewing the images in Apple's Samuel> preview and it displays transparent as gray (not Samuel> checkerboard like photoshop or graphic converter). I still don't understand where the transparency is coming from (unless you are setting the alpha explicitly somewhere else). In the example output I posted previously, the 4th entry in the image RGBAs is 1, indicating that the alpha channel is 1, fully opaque. JDH |
From: Samuel M. S. <sm...@sa...> - 2006-11-22 18:30:30
|
I don't know where the transparency is coming from either. I don't know where I would set the alpha. Could it be in the .rc file? Could it be the way Macs process png files. If you like I can send a copy of the image On 21 Nov, 2006, at 12:29, John Hunter wrote: >>>>>> "Samuel" == Samuel M Smith <sm...@sa...> writes: > > Samuel> I figured it out. It is saving the outside edge as > Samuel> transparent not gray. I was viewing the images in Apple's > Samuel> preview and it displays transparent as gray (not > Samuel> checkerboard like photoshop or graphic converter). > > I still don't understand where the transparency is coming from (unless > you are setting the alpha explicitly somewhere else). In the example > output I posted previously, the 4th entry in the image RGBAs is 1, > indicating that the alpha channel is 1, fully opaque. > > JDH ********************************************************************** Samuel M. Smith Ph.D. 2966 Fort Hill Road Eagle Mountain, Utah 84005-4108 801-768-2768 voice 801-768-2769 fax ********************************************************************** "The greatest source of failure and unhappiness in the world is giving up what we want most for what we want at the moment" ********************************************************************** |
From: John H. <jdh...@ac...> - 2006-11-22 18:36:26
|
>>>>> "Samuel" == Samuel M Smith <sm...@sa...> writes: Samuel> I don't know where the transparency is coming from Samuel> either. I don't know where I would set the alpha. Could it Samuel> be in the .rc file? Could it be the way Macs process png Samuel> files. If you like I can send a copy of the image I looked at it and yes the alpha channel is zero. Very bizarre. Please send a free standing script, the rc file you are using, the output of the script when you run the file with --verbose-helpful and the generated image file. JDH |