From: braingateway <bra...@gm...> - 2010-10-17 22:35:17
|
Hi Everyone, I am trying the matplotlib. I have to say this is a powerful package for scientific 2-D plotting. However, I encountered some problems when try to generate several colormaps. for example: a=cm.get_cmap('gist_rainbow',256)(range(256)) will give a error: Traceback (most recent call last): File "<pyshell#82>", line 1, in <module> a=cm.get_cmap('gist_rainbow',256)(range(256)) File "...\site-packages\matplotlib\colors.py", line 498, in __call__ if not self._isinit: self._init() File "...\site-packages\matplotlib\colors.py", line 649, in _init self._segmentdata['red'], self._gamma) TypeError: tuple indices must be integers, not str but other colormaps can actually work: a=cm.get_cmap('gist_stern',256)(range(256)) >>> a array([[ 0. , 0. , 0. , 1. ], [ 0.0716923 , 0.00392157, 0.00784314, 1. ], [ 0.14338459, 0.00784314, 0.01568627, 1. ], ..., [ 0.99215686, 0.99215686, 0.97040326, 1. ], [ 0.99607843, 0.99607843, 0.98520163, 1. ], [ 1. , 1. , 1. , 1. ]]) I tried all possible colormaps and found out: gist_rainbow, terrain, bwr, brg, and seismic will generate the same error, all other colormaps are OK. I wonder is this a bug or expected behavior? ############################### ##matplotlib verison : '1.0.svn' >>> maps=[m for m in cm.datad if not m.endswith("_r")] >>> for i in maps: try: a=cm.get_cmap(i,256)(range(256)) except: (type, value, traceback) = sys.exc_info() print "Problems to create %s" % (i,) print "The error was --> %s: %s" % (type, value) Problems to create gist_rainbow The error was --> <type 'exceptions.TypeError'>: tuple indices must be integers, not str Problems to create terrain The error was --> <type 'exceptions.TypeError'>: tuple indices must be integers, not str Problems to create bwr The error was --> <type 'exceptions.TypeError'>: tuple indices must be integers, not str Problems to create brg The error was --> <type 'exceptions.TypeError'>: tuple indices must be integers, not str Problems to create seismic The error was --> <type 'exceptions.TypeError'>: tuple indices must be integers, not str ################################################################## |
From: Benjamin R. <ben...@ou...> - 2010-10-17 22:55:21
|
On Sun, Oct 17, 2010 at 5:35 PM, braingateway <bra...@gm...>wrote: > Hi Everyone, > > I am trying the matplotlib. I have to say this is a powerful package for > scientific 2-D plotting. However, I encountered some problems when try > to generate several colormaps. > > for example: > a=cm.get_cmap('gist_rainbow',256)(range(256)) > will give a error: > Traceback (most recent call last): > File "<pyshell#82>", line 1, in <module> > a=cm.get_cmap('gist_rainbow',256)(range(256)) > File "...\site-packages\matplotlib\colors.py", line 498, in __call__ > if not self._isinit: self._init() > File "...\site-packages\matplotlib\colors.py", line 649, in _init > self._segmentdata['red'], self._gamma) > TypeError: tuple indices must be integers, not str > > but other colormaps can actually work: > a=cm.get_cmap('gist_stern',256)(range(256)) > >>> a > array([[ 0. , 0. , 0. , 1. ], > [ 0.0716923 , 0.00392157, 0.00784314, 1. ], > [ 0.14338459, 0.00784314, 0.01568627, 1. ], > ..., > [ 0.99215686, 0.99215686, 0.97040326, 1. ], > [ 0.99607843, 0.99607843, 0.98520163, 1. ], > [ 1. , 1. , 1. , 1. ]]) > > I tried all possible colormaps and found out: gist_rainbow, terrain, > bwr, brg, and seismic will generate the same error, all other colormaps > are OK. I wonder is this a bug or expected behavior? > ############################### > ##matplotlib verison : '1.0.svn' > >>> maps=[m for m in cm.datad if not m.endswith("_r")] > >>> for i in maps: > try: > a=cm.get_cmap(i,256)(range(256)) > except: > (type, value, traceback) = sys.exc_info() > print "Problems to create %s" % (i,) > print "The error was --> %s: %s" % (type, value) > > > Problems to create gist_rainbow > The error was --> <type 'exceptions.TypeError'>: tuple indices must be > integers, not str > Problems to create terrain > The error was --> <type 'exceptions.TypeError'>: tuple indices must be > integers, not str > Problems to create bwr > The error was --> <type 'exceptions.TypeError'>: tuple indices must be > integers, not str > Problems to create brg > The error was --> <type 'exceptions.TypeError'>: tuple indices must be > integers, not str > Problems to create seismic > The error was --> <type 'exceptions.TypeError'>: tuple indices must be > integers, not str > ################################################################## > > Is there any particular reason why you are doing the "(range(256))"? Keep in mind that a colormap in matplotlib works differently than a colormap in Matlab. In Matlab, the colormap is a 2-D array of rgb values, while in matplotlib, it is an object that is used by the backends for color-rendering. Often times, you will not need to do anything more than specify which colormap you want by name e.g., pcolor(X, Y, Z, cmap='gist_rainbow'), or by passing in a customized or self-made colormap object to the 'cmap' keyword argument. What is happening in your code when you call '(range(256))' is that the colormap is being called for an array of values ranging from 0 to 255 and is determining what the color will be for each of those values. What seems to be happening with those few colormaps is that the call is being made before those maps are properly self-initialized. So, there might be some sort of flaw here that you have exposed, but I would suggest taking another look at what you are trying to accomplish to see if there is a better way. Thanks for giving matplotlib a try and I hope you continue to use it for your work! Ben Root |
From: 脑关(BrainGateway)生命科学仪器 <bra...@gm...> - 2010-10-18 09:28:07
|
On Mon, Oct 18, 2010 at 12:54 AM, Benjamin Root <ben...@ou...> wrote: > On Sun, Oct 17, 2010 at 5:35 PM, braingateway <bra...@gm...> > wrote: >> >> Hi Everyone, >> >> I am trying the matplotlib. I have to say this is a powerful package for >> scientific 2-D plotting. However, I encountered some problems when try >> to generate several colormaps. >> >> for example: >> a=cm.get_cmap('gist_rainbow',256)(range(256)) >> will give a error: >> Traceback (most recent call last): >> File "<pyshell#82>", line 1, in <module> >> a=cm.get_cmap('gist_rainbow',256)(range(256)) >> File "...\site-packages\matplotlib\colors.py", line 498, in __call__ >> if not self._isinit: self._init() >> File "...\site-packages\matplotlib\colors.py", line 649, in _init >> self._segmentdata['red'], self._gamma) >> TypeError: tuple indices must be integers, not str >> >> but other colormaps can actually work: >> a=cm.get_cmap('gist_stern',256)(range(256)) >> >>> a >> array([[ 0. , 0. , 0. , 1. ], >> [ 0.0716923 , 0.00392157, 0.00784314, 1. ], >> [ 0.14338459, 0.00784314, 0.01568627, 1. ], >> ..., >> [ 0.99215686, 0.99215686, 0.97040326, 1. ], >> [ 0.99607843, 0.99607843, 0.98520163, 1. ], >> [ 1. , 1. , 1. , 1. ]]) >> >> I tried all possible colormaps and found out: gist_rainbow, terrain, >> bwr, brg, and seismic will generate the same error, all other colormaps >> are OK. I wonder is this a bug or expected behavior? >> ############################### >> ##matplotlib verison : '1.0.svn' >> >>> maps=[m for m in cm.datad if not m.endswith("_r")] >> >>> for i in maps: >> try: >> a=cm.get_cmap(i,256)(range(256)) >> except: >> (type, value, traceback) = sys.exc_info() >> print "Problems to create %s" % (i,) >> print "The error was --> %s: %s" % (type, value) >> >> >> Problems to create gist_rainbow >> The error was --> <type 'exceptions.TypeError'>: tuple indices must be >> integers, not str >> Problems to create terrain >> The error was --> <type 'exceptions.TypeError'>: tuple indices must be >> integers, not str >> Problems to create bwr >> The error was --> <type 'exceptions.TypeError'>: tuple indices must be >> integers, not str >> Problems to create brg >> The error was --> <type 'exceptions.TypeError'>: tuple indices must be >> integers, not str >> Problems to create seismic >> The error was --> <type 'exceptions.TypeError'>: tuple indices must be >> integers, not str >> ################################################################## >> > > Is there any particular reason why you are doing the "(range(256))"? Keep > in mind that a colormap in matplotlib works differently than a colormap in > Matlab. In Matlab, the colormap is a 2-D array of rgb values, while in > matplotlib, it is an object that is used by the backends for > color-rendering. > > Often times, you will not need to do anything more than specify which > colormap you want by name e.g., pcolor(X, Y, Z, cmap='gist_rainbow'), or by > passing in a customized or self-made colormap object to the 'cmap' keyword > argument. > > What is happening in your code when you call '(range(256))' is that the > colormap is being called for an array of values ranging from 0 to 255 and > is determining what the color will be for each of those values. What seems > to be happening with those few colormaps is that the call is being made > before those maps are properly self-initialized. So, there might be some > sort of flaw here that you have exposed, but I would suggest taking another > look at what you are trying to accomplish to see if there is a better way. > > Thanks for giving matplotlib a try and I hope you continue to use it for > your work! > > Ben Root > > Hi Ben, Thanks a lot for answering my question! I am a newbie to matplotlib, so please forgive me, if the question is stupid ;p In my program I wanna know the exact RGBA value of a data point in the figure, in order to plot a corresponding line with the same color in another figure. That is why I need to call a(z) to get RGBA value of a point at (x,y,z) (z is represented by color). If I understood it correctly, you said I do not need to specify the 'lut' in cm.get_cmap(name,lut)? I thought the colormap object is actually a lookup table with a length specified by lut. It turns out I do not need to specify anything here. But if I do not specify anything the colormap.N is always 256. What will happen then, if I need more color steps? I do notice a(2) and a(2.2) returns different values. So I am very confused about the principle how the RGBA value is generated by the colormaps. LittleBigBrain |
From: Friedrich R. <fri...@gm...> - 2010-10-18 10:46:37
|
2010/10/18 脑关(BrainGateway)生命科学仪器 <bra...@gm...>: > On Mon, Oct 18, 2010 at 12:54 AM, Benjamin Root <ben...@ou...> wrote: >> On Sun, Oct 17, 2010 at 5:35 PM, braingateway <bra...@gm...> >> wrote: >>> I tried all possible colormaps and found out: gist_rainbow, terrain, >>> bwr, brg, and seismic will generate the same error, all other colormaps >>> are OK. I wonder is this a bug or expected behavior? > Hi Ben, > Thanks a lot for answering my question! I am a newbie to matplotlib, > so please forgive me, if the question is stupid ;p Questions are never stupid ... > In my program I wanna know the exact RGBA value of a data point in the > figure, in order to plot a corresponding line with the same color in > another figure. That is why I need to call a(z) to get RGBA value of a > point at (x,y,z) (z is represented by color). If I understood it > correctly, you said I do not need to specify the 'lut' in > cm.get_cmap(name,lut)? I thought the colormap object is actually a > lookup table with a length specified by lut. Kind of, but it's initialised from a linear segmentation dictionary, so you can get cmaps with a precision you want. > It turns out I do not > need to specify anything here. Default param is 256. > But if I do not specify anything the > colormap.N is always 256. What will happen then, if I need more color > steps? cm = get_cmap('...', 1024) > I do notice a(2) and a(2.2) returns different values. So I am > very confused about the principle how the RGBA value is generated by > the colormaps. It's the "magic" to distinguish between integer (in the LUT range) and float (in [0.0, 1.0]). 2 gives the LUT entry 2, 2.0 will give the upper value since it's > 1, as will 2.2 do. Try 0.5, and 0.6, or 0.0 and 0.1. Actually I cannot reproduce your error on a recently (some weeks ago) checked-out GitHub repo version of mpl 1.0.0. Please provide mpl.__version__ so that we check if that's the reason - as simple as it might be. MacBook-Pro-Friedrich:Report Friedrich$ python Python 2.6.5 (r265:79063, Jul 18 2010, 12:14:53) [GCC 4.2.1 (Apple Inc. build 5659)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import matplotlib.cm >>> cm = matplotlib.cm.get_cmap('gist_rainbow') >>> cm(range(256)) array([[ 1. , 0. , 0.16 , 1. ], [ 1. , 0. , 0.13908497, 1. ], [ 1. , 0. , 0.11816993, 1. ], ..., [ 1. , 0. , 0.79262575, 1. ], [ 1. , 0. , 0.77131287, 1. ], [ 1. , 0. , 0.75 , 1. ]]) >>> print matplotlib.__version__ 1.0.0 The attribute of the cm where the error occurs on your machine is set to a valid value for me. I also cannot find any code path leading to a wrong initialisation of the attribute. Might be that the data the cm is init'ed from changed. There is a code path initialising the cm from a tuple (your attribute was a tuple used like a dict), but this works too: (terrain is such an example): >>> cm = matplotlib.cm.get_cmap('terrain') >>> cm(range(256)) array([[ 0.2 , 0.2 , 0.6 , 1. ], [ 0.19477124, 0.21045752, 0.61045752, 1. ], [ 0.18954248, 0.22091503, 0.62091503, 1. ], ..., [ 0.98431373, 0.97992157, 0.97898039, 1. ], [ 0.99215686, 0.98996078, 0.9894902 , 1. ], [ 1. , 1. , 1. , 1. ]]) Might be that there was 'red' misspelled in gist_rainbow in you mpl version, this may explain the behaviour if we track it down. Can you do the following to verify this: import matplotlib._cm print matplotlib._cm._gist_stern_data ? Thx, Friedrich |
From: LittleBigBrain <bra...@gm...> - 2010-10-18 11:51:16
|
2010/10/18 Friedrich Romstedt <fri...@gm...>: > 2010/10/18 脑关(BrainGateway)生命科学仪器 <bra...@gm...>: >> On Mon, Oct 18, 2010 at 12:54 AM, Benjamin Root <ben...@ou...> wrote: >>> On Sun, Oct 17, 2010 at 5:35 PM, braingateway <bra...@gm...> >>> wrote: >>>> I tried all possible colormaps and found out: gist_rainbow, terrain, >>>> bwr, brg, and seismic will generate the same error, all other colormaps >>>> are OK. I wonder is this a bug or expected behavior? >> Hi Ben, >> Thanks a lot for answering my question! I am a newbie to matplotlib, >> so please forgive me, if the question is stupid ;p > > Questions are never stupid ... > >> In my program I wanna know the exact RGBA value of a data point in the >> figure, in order to plot a corresponding line with the same color in >> another figure. That is why I need to call a(z) to get RGBA value of a >> point at (x,y,z) (z is represented by color). If I understood it >> correctly, you said I do not need to specify the 'lut' in >> cm.get_cmap(name,lut)? I thought the colormap object is actually a >> lookup table with a length specified by lut. > > Kind of, but it's initialised from a linear segmentation dictionary, > so you can get cmaps with a precision you want. > >> It turns out I do not >> need to specify anything here. > > Default param is 256. > >> But if I do not specify anything the >> colormap.N is always 256. What will happen then, if I need more color >> steps? > > cm = get_cmap('...', 1024) > >> I do notice a(2) and a(2.2) returns different values. So I am >> very confused about the principle how the RGBA value is generated by >> the colormaps. > > It's the "magic" to distinguish between integer (in the LUT range) and > float (in [0.0, 1.0]). 2 gives the LUT entry 2, 2.0 will give the > upper value since it's > 1, as will 2.2 do. Try 0.5, and 0.6, or 0.0 > and 0.1. > > Actually I cannot reproduce your error on a recently (some weeks ago) > checked-out GitHub repo version of mpl 1.0.0. Please provide > mpl.__version__ so that we check if that's the reason - as simple as > it might be. > > MacBook-Pro-Friedrich:Report Friedrich$ python > Python 2.6.5 (r265:79063, Jul 18 2010, 12:14:53) > [GCC 4.2.1 (Apple Inc. build 5659)] on darwin > Type "help", "copyright", "credits" or "license" for more information. >>>> import matplotlib.cm >>>> cm = matplotlib.cm.get_cmap('gist_rainbow') >>>> cm(range(256)) > array([[ 1. , 0. , 0.16 , 1. ], > [ 1. , 0. , 0.13908497, 1. ], > [ 1. , 0. , 0.11816993, 1. ], > ..., > [ 1. , 0. , 0.79262575, 1. ], > [ 1. , 0. , 0.77131287, 1. ], > [ 1. , 0. , 0.75 , 1. ]]) >>>> print matplotlib.__version__ > 1.0.0 > > The attribute of the cm where the error occurs on your machine is set > to a valid value for me. I also cannot find any code path leading to > a wrong initialisation of the attribute. Might be that the data the > cm is init'ed from changed. There is a code path initialising the cm > from a tuple (your attribute was a tuple used like a dict), but this > works too: (terrain is such an example): > >>>> cm = matplotlib.cm.get_cmap('terrain') >>>> cm(range(256)) > array([[ 0.2 , 0.2 , 0.6 , 1. ], > [ 0.19477124, 0.21045752, 0.61045752, 1. ], > [ 0.18954248, 0.22091503, 0.62091503, 1. ], > ..., > [ 0.98431373, 0.97992157, 0.97898039, 1. ], > [ 0.99215686, 0.98996078, 0.9894902 , 1. ], > [ 1. , 1. , 1. , 1. ]]) > > Might be that there was 'red' misspelled in gist_rainbow in you mpl > version, this may explain the behaviour if we track it down. Can you > do the following to verify this: > > import matplotlib._cm > print matplotlib._cm._gist_stern_data > > ? Thx, > Friedrich > Thanks a lot for your detailed response! In previous posts I did give the version: '1.0.svn'. Then I installed the latest stable version. Here is the version info: >>> print matplotlib.__version__ 1.0.0 However, the error is still there. You could not reproduce the error in your code, because you did not specify 'lut' when you call get_cmap try this: maps=[m for m in matplotlib.cm.datad if not m.endswith("_r")] for i in maps: try: a=matplotlib.cm.get_cmap(i,256)(range(256)) except: (type, value, traceback) = sys.exc_info() print "Problems to create %s" % (i,) print "The error was --> %s: %s" % (type, value) u will reproduce the error. Thanks very much to point out I could actually print the colormap definition-data. I printed all of them, and found out the colormaps invoking errors are all tuples but not dictionaries and all other colormaps are actually dictionaries. ###Examples without Errors### ###They are all dictionaries### print matplotlib._cm._gist_stern_data {'blue': ((0.0, 0.0, 0.0), (0.5, 1.0, 1.0), (0.73499999999999999, 0.0, 0.0), (1.0, 1.0, 1.0)), 'green': ((0, 0, 0), (1, 1, 1)), 'red': ((0.0, 0.0, 0.0), (0.054699999999999999, 1.0, 1.0), (0.25, 0.027, 0.25), (1.0, 1.0, 1.0))} print matplotlib._cm._jet_data {'blue': ((0.0, 0.5, 0.5), (0.11, 1, 1), (0.34000000000000002, 1, 1), (0.65000000000000002, 0, 0), (1, 0, 0)), 'green': ((0.0, 0, 0), (0.125, 0, 0), (0.375, 1, 1), (0.64000000000000001, 1, 1), (0.91000000000000003, 0, 0), (1, 0, 0)), 'red': ((0.0, 0, 0), (0.34999999999999998, 0, 0), (0.66000000000000003, 1, 1), (0.89000000000000001, 1, 1), (1, 0.5, 0.5))} ###Colormaps invoking Errors### ###They are all Tuples### Problems to create gist_rainbow ((0.0, (1.0, 0.0, 0.16)), (0.029999999999999999, (1.0, 0.0, 0.0)), (0.215, (1.0, 1.0, 0.0)), (0.40000000000000002, (0.0, 1.0, 0.0)), (0.58599999999999997, (0.0, 1.0, 1.0)), (0.77000000000000002, (0.0, 0.0, 1.0)), (0.95399999999999996, (1.0, 0.0, 1.0)), (1.0, (1.0, 0.0, 0.75))) The error was --> <type 'exceptions.TypeError'>: tuple indices must be integers, not str Problems to create terrain ((0.0, (0.20000000000000001, 0.20000000000000001, 0.59999999999999998)), (0.14999999999999999, (0.0, 0.59999999999999998, 1.0)), (0.25, (0.0, 0.80000000000000004, 0.40000000000000002)), (0.5, (1.0, 1.0, 0.59999999999999998)), (0.75, (0.5, 0.35999999999999999, 0.33000000000000002)), (1.0, (1.0, 1.0, 1.0))) The error was --> <type 'exceptions.TypeError'>: tuple indices must be integers, not str Problems to create bwr ((0.0, 0.0, 1.0), (1.0, 1.0, 1.0), (1.0, 0.0, 0.0)) The error was --> <type 'exceptions.TypeError'>: tuple indices must be integers, not str Problems to create brg ((0.0, 0.0, 1.0), (1.0, 0.0, 0.0), (0.0, 1.0, 0.0)) The error was --> <type 'exceptions.TypeError'>: tuple indices must be integers, not str Problems to create seismic ((0.0, 0.0, 0.29999999999999999), (0.0, 0.0, 1.0), (1.0, 1.0, 1.0), (1.0, 0.0, 0.0), (0.5, 0.0, 0.0)) The error was --> <type 'exceptions.TypeError'>: tuple indices must be integers, not str |
From: Friedrich R. <fri...@gm...> - 2010-10-18 16:23:29
Attachments:
cm.py
|
2010/10/18 LittleBigBrain <bra...@gm...>: > Hi Friedrich, > > Thanks for produce the patch. But I do not know how to use 'git'. And > I cannot find the changes you made on web. > though the latest update by you is 2 hours ago, in the online source > archive the latest file is modified on October 11, 2010 in 'trunk'. Yes I agree, I didn't check, I was too quick. Thanks for this further bug report in Friedrich Romstedt.py :-). I forgot to push the new branch. The file is here online: http://github.com/friedrichromstedt/matplotlib/blob/friedrichromstedt-get_cmap/lib/matplotlib/cm.py. Notice that the default branch on the repo is grayscale, when you go in via http://github.com/friedrichromstedt/matplotlib. I send the file attached. Just rename the current cm.py and put in the new one, it should work. You said you were using svn before, so I assumed you compiled yourself. How did you manage to use svn without compiling? Can you run the test suite? Friedrich |
From: LittleBigBrain <bra...@gm...> - 2010-10-18 18:25:08
|
On Mon, Oct 18, 2010 at 6:23 PM, Friedrich Romstedt <fri...@gm...> wrote: > 2010/10/18 LittleBigBrain <bra...@gm...>: >> Hi Friedrich, >> >> Thanks for produce the patch. But I do not know how to use 'git'. And >> I cannot find the changes you made on web. >> though the latest update by you is 2 hours ago, in the online source >> archive the latest file is modified on October 11, 2010 in 'trunk'. > > Yes I agree, I didn't check, I was too quick. Thanks for this further > bug report in Friedrich Romstedt.py :-). I forgot to push the new > branch. > > The file is here online: > http://github.com/friedrichromstedt/matplotlib/blob/friedrichromstedt-get_cmap/lib/matplotlib/cm.py. > Notice that the default branch on the repo is grayscale, when you go > in via http://github.com/friedrichromstedt/matplotlib. > > I send the file attached. Just rename the current cm.py and put in > the new one, it should work. You said you were using svn before, so I > assumed you compiled yourself. How did you manage to use svn without > compiling? > > Can you run the test suite? > > Friedrich > The colormap functions seem all OK. But I got other errors irrelevant to your update. I manually checked all images invoking errors, they are all OK. Somehow, their file handles are not closed properly before reopening. Here is the test result: >>> import nose >>> print nose.__version__ 0.11.4 >>> import PIL >>> print PIL.__version__ >>> from PIL import Image >>> Image.VERSION '1.1.7' >>> import matplotlib >>> matplotlib.__version__ '1.0.0' >>> matplotlib.test() FAILED (KNOWNFAIL=90, errors=14) ====================================================================== ERROR: matplotlib.tests.test_axes.test_basic_annotate ---------------------------------------------------------------------- Traceback (most recent call last): File "C:\Python26\lib\site-packages\nose-0.11.4-py2.6.egg\nose\case.py", line 186, in runTest self.test(*self.arg) File "C:\Python26\lib\site-packages\matplotlib\testing\decorators.py", line 32, in failer result = f(*args, **kwargs) File "C:\Python26\lib\site-packages\matplotlib\testing\decorators.py", line 126, in decorated_compare_images '(RMS %(rms).3f)'%err) ImageComparisonFailure: images not close: D:\works\matplotlibTest\result_images\test_axes\offset_points.png vs. D:\works\matplotlibTest\result_images\test_axes\expected-offset_points.png (RMS 223.063) ====================================================================== ERROR: matplotlib.tests.test_axes.test_fill_units ---------------------------------------------------------------------- Traceback (most recent call last): File "C:\Python26\lib\site-packages\nose-0.11.4-py2.6.egg\nose\case.py", line 186, in runTest self.test(*self.arg) File "C:\Python26\lib\site-packages\matplotlib\testing\decorators.py", line 32, in failer result = f(*args, **kwargs) File "C:\Python26\lib\site-packages\matplotlib\testing\decorators.py", line 126, in decorated_compare_images '(RMS %(rms).3f)'%err) ImageComparisonFailure: images not close: D:\works\matplotlibTest\result_images\test_axes\fill_units.png vs. D:\works\matplotlibTest\result_images\test_axes\expected-fill_units.png (RMS 58.830) ====================================================================== ERROR: matplotlib.tests.test_axes.test_single_point ---------------------------------------------------------------------- Traceback (most recent call last): File "C:\Python26\lib\site-packages\nose-0.11.4-py2.6.egg\nose\case.py", line 186, in runTest self.test(*self.arg) File "C:\Python26\lib\site-packages\matplotlib\testing\decorators.py", line 32, in failer result = f(*args, **kwargs) File "C:\Python26\lib\site-packages\matplotlib\testing\decorators.py", line 126, in decorated_compare_images '(RMS %(rms).3f)'%err) ImageComparisonFailure: images not close: D:\works\matplotlibTest\result_images\test_axes\single_point.png vs. D:\works\matplotlibTest\result_images\test_axes\expected-single_point.png (RMS 11.705) ====================================================================== ERROR: matplotlib.tests.test_axes.test_single_date ---------------------------------------------------------------------- Traceback (most recent call last): File "C:\Python26\lib\site-packages\nose-0.11.4-py2.6.egg\nose\case.py", line 186, in runTest self.test(*self.arg) File "C:\Python26\lib\site-packages\matplotlib\testing\decorators.py", line 32, in failer result = f(*args, **kwargs) File "C:\Python26\lib\site-packages\matplotlib\testing\decorators.py", line 126, in decorated_compare_images '(RMS %(rms).3f)'%err) ImageComparisonFailure: images not close: D:\works\matplotlibTest\result_images\test_axes\single_date.png vs. D:\works\matplotlibTest\result_images\test_axes\expected-single_date.png (RMS 583.302) ====================================================================== ERROR: matplotlib.tests.test_axes.test_shaped_data ---------------------------------------------------------------------- Traceback (most recent call last): File "C:\Python26\lib\site-packages\nose-0.11.4-py2.6.egg\nose\case.py", line 186, in runTest self.test(*self.arg) File "C:\Python26\lib\site-packages\matplotlib\testing\decorators.py", line 32, in failer result = f(*args, **kwargs) File "C:\Python26\lib\site-packages\matplotlib\testing\decorators.py", line 126, in decorated_compare_images '(RMS %(rms).3f)'%err) ImageComparisonFailure: images not close: D:\works\matplotlibTest\result_images\test_axes\shaped_data.png vs. D:\works\matplotlibTest\result_images\test_axes\expected-shaped_data.png (RMS 823.859) ====================================================================== ERROR: matplotlib.tests.test_axes.test_const_xy ---------------------------------------------------------------------- Traceback (most recent call last): File "C:\Python26\lib\site-packages\nose-0.11.4-py2.6.egg\nose\case.py", line 186, in runTest self.test(*self.arg) File "C:\Python26\lib\site-packages\matplotlib\testing\decorators.py", line 32, in failer result = f(*args, **kwargs) File "C:\Python26\lib\site-packages\matplotlib\testing\decorators.py", line 126, in decorated_compare_images '(RMS %(rms).3f)'%err) ImageComparisonFailure: images not close: D:\works\matplotlibTest\result_images\test_axes\const_xy.png vs. D:\works\matplotlibTest\result_images\test_axes\expected-const_xy.png (RMS 462.317) ====================================================================== ERROR: matplotlib.tests.test_axes.test_polar_wrap ---------------------------------------------------------------------- Traceback (most recent call last): File "C:\Python26\lib\site-packages\nose-0.11.4-py2.6.egg\nose\case.py", line 186, in runTest self.test(*self.arg) File "C:\Python26\lib\site-packages\matplotlib\testing\decorators.py", line 32, in failer result = f(*args, **kwargs) File "C:\Python26\lib\site-packages\matplotlib\testing\decorators.py", line 126, in decorated_compare_images '(RMS %(rms).3f)'%err) ImageComparisonFailure: images not close: D:\works\matplotlibTest\result_images\test_axes\polar_wrap_180.png vs. D:\works\matplotlibTest\result_images\test_axes\expected-polar_wrap_180.png (RMS 59.783) ====================================================================== ERROR: matplotlib.tests.test_axes.test_polar_units ---------------------------------------------------------------------- Traceback (most recent call last): File "C:\Python26\lib\site-packages\nose-0.11.4-py2.6.egg\nose\case.py", line 186, in runTest self.test(*self.arg) File "C:\Python26\lib\site-packages\matplotlib\testing\decorators.py", line 32, in failer result = f(*args, **kwargs) File "C:\Python26\lib\site-packages\matplotlib\testing\decorators.py", line 126, in decorated_compare_images '(RMS %(rms).3f)'%err) ImageComparisonFailure: images not close: D:\works\matplotlibTest\result_images\test_axes\polar_units.png vs. D:\works\matplotlibTest\result_images\test_axes\expected-polar_units.png (RMS 59.557) ====================================================================== ERROR: matplotlib.tests.test_axes.test_polar_rmin ---------------------------------------------------------------------- Traceback (most recent call last): File "C:\Python26\lib\site-packages\nose-0.11.4-py2.6.egg\nose\case.py", line 186, in runTest self.test(*self.arg) File "C:\Python26\lib\site-packages\matplotlib\testing\decorators.py", line 32, in failer result = f(*args, **kwargs) File "C:\Python26\lib\site-packages\matplotlib\testing\decorators.py", line 126, in decorated_compare_images '(RMS %(rms).3f)'%err) ImageComparisonFailure: images not close: D:\works\matplotlibTest\result_images\test_axes\polar_rmin.png vs. D:\works\matplotlibTest\result_images\test_axes\expected-polar_rmin.png (RMS 40.497) ====================================================================== ERROR: matplotlib.tests.test_axes.test_symlog ---------------------------------------------------------------------- Traceback (most recent call last): File "C:\Python26\lib\site-packages\nose-0.11.4-py2.6.egg\nose\case.py", line 186, in runTest self.test(*self.arg) File "C:\Python26\lib\site-packages\matplotlib\testing\decorators.py", line 32, in failer result = f(*args, **kwargs) File "C:\Python26\lib\site-packages\matplotlib\testing\decorators.py", line 126, in decorated_compare_images '(RMS %(rms).3f)'%err) ImageComparisonFailure: images not close: D:\works\matplotlibTest\result_images\test_axes\symlog.png vs. D:\works\matplotlibTest\result_images\test_axes\expected-symlog.png (RMS 71.042) ====================================================================== ERROR: matplotlib.tests.test_image.test_image_clip ---------------------------------------------------------------------- Traceback (most recent call last): File "C:\Python26\lib\site-packages\nose-0.11.4-py2.6.egg\nose\case.py", line 186, in runTest self.test(*self.arg) File "C:\Python26\lib\site-packages\matplotlib\testing\decorators.py", line 32, in failer result = f(*args, **kwargs) File "C:\Python26\lib\site-packages\matplotlib\testing\decorators.py", line 126, in decorated_compare_images '(RMS %(rms).3f)'%err) ImageComparisonFailure: images not close: D:\works\matplotlibTest\result_images\test_image\image_clip.png vs. D:\works\matplotlibTest\result_images\test_image\expected-image_clip.png (RMS 323.003) ====================================================================== ERROR: matplotlib.tests.test_mathtext.test_mathtext ---------------------------------------------------------------------- Traceback (most recent call last): File "C:\Python26\lib\site-packages\nose-0.11.4-py2.6.egg\nose\case.py", line 186, in runTest self.test(*self.arg) File "C:\Python26\lib\site-packages\matplotlib\testing\decorators.py", line 32, in failer result = f(*args, **kwargs) File "C:\Python26\lib\site-packages\matplotlib\testing\decorators.py", line 126, in decorated_compare_images '(RMS %(rms).3f)'%err) ImageComparisonFailure: images not close: D:\works\matplotlibTest\result_images\test_mathtext\mathtext.png vs. D:\works\matplotlibTest\result_images\test_mathtext\expected-mathtext.png (RMS 41.845) ====================================================================== ERROR: matplotlib.tests.test_mathtext.test_mathtext_stix ---------------------------------------------------------------------- Traceback (most recent call last): File "C:\Python26\lib\site-packages\nose-0.11.4-py2.6.egg\nose\case.py", line 186, in runTest self.test(*self.arg) File "C:\Python26\lib\site-packages\matplotlib\testing\decorators.py", line 32, in failer result = f(*args, **kwargs) File "C:\Python26\lib\site-packages\matplotlib\testing\decorators.py", line 126, in decorated_compare_images '(RMS %(rms).3f)'%err) ImageComparisonFailure: images not close: D:\works\matplotlibTest\result_images\test_mathtext\mathtext_stix.png vs. D:\works\matplotlibTest\result_images\test_mathtext\expected-mathtext_stix.png (RMS 29.816) ====================================================================== ERROR: matplotlib.tests.test_mathtext.test_mathtext_stixsans ---------------------------------------------------------------------- Traceback (most recent call last): File "C:\Python26\lib\site-packages\nose-0.11.4-py2.6.egg\nose\case.py", line 186, in runTest self.test(*self.arg) File "C:\Python26\lib\site-packages\matplotlib\testing\decorators.py", line 32, in failer result = f(*args, **kwargs) File "C:\Python26\lib\site-packages\matplotlib\testing\decorators.py", line 126, in decorated_compare_images '(RMS %(rms).3f)'%err) ImageComparisonFailure: images not close: D:\works\matplotlibTest\result_images\test_mathtext\mathtext_stixsans.png vs. D:\works\matplotlibTest\result_images\test_mathtext\expected-mathtext_stixsans.png (RMS 21.471) ---------------------------------------------------------------------- Ran 150 tests in 100.386s |
From: LittleBigBrain <bra...@gm...> - 2010-10-18 18:34:15
|
On Mon, Oct 18, 2010 at 8:25 PM, LittleBigBrain <bra...@gm...> wrote: > On Mon, Oct 18, 2010 at 6:23 PM, Friedrich Romstedt > <fri...@gm...> wrote: >> 2010/10/18 LittleBigBrain <bra...@gm...>: >>> Hi Friedrich, >>> >>> Thanks for produce the patch. But I do not know how to use 'git'. And >>> I cannot find the changes you made on web. >>> though the latest update by you is 2 hours ago, in the online source >>> archive the latest file is modified on October 11, 2010 in 'trunk'. >> >> Yes I agree, I didn't check, I was too quick. Thanks for this further >> bug report in Friedrich Romstedt.py :-). I forgot to push the new >> branch. >> >> The file is here online: >> http://github.com/friedrichromstedt/matplotlib/blob/friedrichromstedt-get_cmap/lib/matplotlib/cm.py. >> Notice that the default branch on the repo is grayscale, when you go >> in via http://github.com/friedrichromstedt/matplotlib. >> >> I send the file attached. Just rename the current cm.py and put in >> the new one, it should work. You said you were using svn before, so I >> assumed you compiled yourself. How did you manage to use svn without >> compiling? >> >> Can you run the test suite? >> >> Friedrich >> > The colormap functions seem all OK. But I got other errors irrelevant > to your update. I manually checked all images invoking errors, they > are all OK. Somehow, their file handles are not closed properly before ~~~~~~~~~~~~~~~~~~No, I was wrong. For some reason, the RMS are too big. But with a glance, I did not see any visible difference in the pictures so far. > reopening. > > Here is the test result: >>>> import nose >>>> print nose.__version__ > 0.11.4 >>>> import PIL >>>> print PIL.__version__ >>>> from PIL import Image >>>> Image.VERSION > '1.1.7' >>>> import matplotlib >>>> matplotlib.__version__ > '1.0.0' >>>> matplotlib.test() > FAILED (KNOWNFAIL=90, errors=14) > ====================================================================== > ERROR: matplotlib.tests.test_axes.test_basic_annotate > ---------------------------------------------------------------------- > Traceback (most recent call last): > File "C:\Python26\lib\site-packages\nose-0.11.4-py2.6.egg\nose\case.py", > line 186, in runTest > self.test(*self.arg) > File "C:\Python26\lib\site-packages\matplotlib\testing\decorators.py", > line 32, in failer > result = f(*args, **kwargs) > File "C:\Python26\lib\site-packages\matplotlib\testing\decorators.py", > line 126, in decorated_compare_images > '(RMS %(rms).3f)'%err) > ImageComparisonFailure: images not close: > D:\works\matplotlibTest\result_images\test_axes\offset_points.png vs. > D:\works\matplotlibTest\result_images\test_axes\expected-offset_points.png > (RMS 223.063) > > ====================================================================== > ERROR: matplotlib.tests.test_axes.test_fill_units > ---------------------------------------------------------------------- > Traceback (most recent call last): > File "C:\Python26\lib\site-packages\nose-0.11.4-py2.6.egg\nose\case.py", > line 186, in runTest > self.test(*self.arg) > File "C:\Python26\lib\site-packages\matplotlib\testing\decorators.py", > line 32, in failer > result = f(*args, **kwargs) > File "C:\Python26\lib\site-packages\matplotlib\testing\decorators.py", > line 126, in decorated_compare_images > '(RMS %(rms).3f)'%err) > ImageComparisonFailure: images not close: > D:\works\matplotlibTest\result_images\test_axes\fill_units.png vs. > D:\works\matplotlibTest\result_images\test_axes\expected-fill_units.png > (RMS 58.830) > > ====================================================================== > ERROR: matplotlib.tests.test_axes.test_single_point > ---------------------------------------------------------------------- > Traceback (most recent call last): > File "C:\Python26\lib\site-packages\nose-0.11.4-py2.6.egg\nose\case.py", > line 186, in runTest > self.test(*self.arg) > File "C:\Python26\lib\site-packages\matplotlib\testing\decorators.py", > line 32, in failer > result = f(*args, **kwargs) > File "C:\Python26\lib\site-packages\matplotlib\testing\decorators.py", > line 126, in decorated_compare_images > '(RMS %(rms).3f)'%err) > ImageComparisonFailure: images not close: > D:\works\matplotlibTest\result_images\test_axes\single_point.png vs. > D:\works\matplotlibTest\result_images\test_axes\expected-single_point.png > (RMS 11.705) > > ====================================================================== > ERROR: matplotlib.tests.test_axes.test_single_date > ---------------------------------------------------------------------- > Traceback (most recent call last): > File "C:\Python26\lib\site-packages\nose-0.11.4-py2.6.egg\nose\case.py", > line 186, in runTest > self.test(*self.arg) > File "C:\Python26\lib\site-packages\matplotlib\testing\decorators.py", > line 32, in failer > result = f(*args, **kwargs) > File "C:\Python26\lib\site-packages\matplotlib\testing\decorators.py", > line 126, in decorated_compare_images > '(RMS %(rms).3f)'%err) > ImageComparisonFailure: images not close: > D:\works\matplotlibTest\result_images\test_axes\single_date.png vs. > D:\works\matplotlibTest\result_images\test_axes\expected-single_date.png > (RMS 583.302) > > ====================================================================== > ERROR: matplotlib.tests.test_axes.test_shaped_data > ---------------------------------------------------------------------- > Traceback (most recent call last): > File "C:\Python26\lib\site-packages\nose-0.11.4-py2.6.egg\nose\case.py", > line 186, in runTest > self.test(*self.arg) > File "C:\Python26\lib\site-packages\matplotlib\testing\decorators.py", > line 32, in failer > result = f(*args, **kwargs) > File "C:\Python26\lib\site-packages\matplotlib\testing\decorators.py", > line 126, in decorated_compare_images > '(RMS %(rms).3f)'%err) > ImageComparisonFailure: images not close: > D:\works\matplotlibTest\result_images\test_axes\shaped_data.png vs. > D:\works\matplotlibTest\result_images\test_axes\expected-shaped_data.png > (RMS 823.859) > > ====================================================================== > ERROR: matplotlib.tests.test_axes.test_const_xy > ---------------------------------------------------------------------- > Traceback (most recent call last): > File "C:\Python26\lib\site-packages\nose-0.11.4-py2.6.egg\nose\case.py", > line 186, in runTest > self.test(*self.arg) > File "C:\Python26\lib\site-packages\matplotlib\testing\decorators.py", > line 32, in failer > result = f(*args, **kwargs) > File "C:\Python26\lib\site-packages\matplotlib\testing\decorators.py", > line 126, in decorated_compare_images > '(RMS %(rms).3f)'%err) > ImageComparisonFailure: images not close: > D:\works\matplotlibTest\result_images\test_axes\const_xy.png vs. > D:\works\matplotlibTest\result_images\test_axes\expected-const_xy.png > (RMS 462.317) > > ====================================================================== > ERROR: matplotlib.tests.test_axes.test_polar_wrap > ---------------------------------------------------------------------- > Traceback (most recent call last): > File "C:\Python26\lib\site-packages\nose-0.11.4-py2.6.egg\nose\case.py", > line 186, in runTest > self.test(*self.arg) > File "C:\Python26\lib\site-packages\matplotlib\testing\decorators.py", > line 32, in failer > result = f(*args, **kwargs) > File "C:\Python26\lib\site-packages\matplotlib\testing\decorators.py", > line 126, in decorated_compare_images > '(RMS %(rms).3f)'%err) > ImageComparisonFailure: images not close: > D:\works\matplotlibTest\result_images\test_axes\polar_wrap_180.png vs. > D:\works\matplotlibTest\result_images\test_axes\expected-polar_wrap_180.png > (RMS 59.783) > > ====================================================================== > ERROR: matplotlib.tests.test_axes.test_polar_units > ---------------------------------------------------------------------- > Traceback (most recent call last): > File "C:\Python26\lib\site-packages\nose-0.11.4-py2.6.egg\nose\case.py", > line 186, in runTest > self.test(*self.arg) > File "C:\Python26\lib\site-packages\matplotlib\testing\decorators.py", > line 32, in failer > result = f(*args, **kwargs) > File "C:\Python26\lib\site-packages\matplotlib\testing\decorators.py", > line 126, in decorated_compare_images > '(RMS %(rms).3f)'%err) > ImageComparisonFailure: images not close: > D:\works\matplotlibTest\result_images\test_axes\polar_units.png vs. > D:\works\matplotlibTest\result_images\test_axes\expected-polar_units.png > (RMS 59.557) > > ====================================================================== > ERROR: matplotlib.tests.test_axes.test_polar_rmin > ---------------------------------------------------------------------- > Traceback (most recent call last): > File "C:\Python26\lib\site-packages\nose-0.11.4-py2.6.egg\nose\case.py", > line 186, in runTest > self.test(*self.arg) > File "C:\Python26\lib\site-packages\matplotlib\testing\decorators.py", > line 32, in failer > result = f(*args, **kwargs) > File "C:\Python26\lib\site-packages\matplotlib\testing\decorators.py", > line 126, in decorated_compare_images > '(RMS %(rms).3f)'%err) > ImageComparisonFailure: images not close: > D:\works\matplotlibTest\result_images\test_axes\polar_rmin.png vs. > D:\works\matplotlibTest\result_images\test_axes\expected-polar_rmin.png > (RMS 40.497) > > ====================================================================== > ERROR: matplotlib.tests.test_axes.test_symlog > ---------------------------------------------------------------------- > Traceback (most recent call last): > File "C:\Python26\lib\site-packages\nose-0.11.4-py2.6.egg\nose\case.py", > line 186, in runTest > self.test(*self.arg) > File "C:\Python26\lib\site-packages\matplotlib\testing\decorators.py", > line 32, in failer > result = f(*args, **kwargs) > File "C:\Python26\lib\site-packages\matplotlib\testing\decorators.py", > line 126, in decorated_compare_images > '(RMS %(rms).3f)'%err) > ImageComparisonFailure: images not close: > D:\works\matplotlibTest\result_images\test_axes\symlog.png vs. > D:\works\matplotlibTest\result_images\test_axes\expected-symlog.png > (RMS 71.042) > > ====================================================================== > ERROR: matplotlib.tests.test_image.test_image_clip > ---------------------------------------------------------------------- > Traceback (most recent call last): > File "C:\Python26\lib\site-packages\nose-0.11.4-py2.6.egg\nose\case.py", > line 186, in runTest > self.test(*self.arg) > File "C:\Python26\lib\site-packages\matplotlib\testing\decorators.py", > line 32, in failer > result = f(*args, **kwargs) > File "C:\Python26\lib\site-packages\matplotlib\testing\decorators.py", > line 126, in decorated_compare_images > '(RMS %(rms).3f)'%err) > ImageComparisonFailure: images not close: > D:\works\matplotlibTest\result_images\test_image\image_clip.png vs. > D:\works\matplotlibTest\result_images\test_image\expected-image_clip.png > (RMS 323.003) > > ====================================================================== > ERROR: matplotlib.tests.test_mathtext.test_mathtext > ---------------------------------------------------------------------- > Traceback (most recent call last): > File "C:\Python26\lib\site-packages\nose-0.11.4-py2.6.egg\nose\case.py", > line 186, in runTest > self.test(*self.arg) > File "C:\Python26\lib\site-packages\matplotlib\testing\decorators.py", > line 32, in failer > result = f(*args, **kwargs) > File "C:\Python26\lib\site-packages\matplotlib\testing\decorators.py", > line 126, in decorated_compare_images > '(RMS %(rms).3f)'%err) > ImageComparisonFailure: images not close: > D:\works\matplotlibTest\result_images\test_mathtext\mathtext.png vs. > D:\works\matplotlibTest\result_images\test_mathtext\expected-mathtext.png > (RMS 41.845) > > ====================================================================== > ERROR: matplotlib.tests.test_mathtext.test_mathtext_stix > ---------------------------------------------------------------------- > Traceback (most recent call last): > File "C:\Python26\lib\site-packages\nose-0.11.4-py2.6.egg\nose\case.py", > line 186, in runTest > self.test(*self.arg) > File "C:\Python26\lib\site-packages\matplotlib\testing\decorators.py", > line 32, in failer > result = f(*args, **kwargs) > File "C:\Python26\lib\site-packages\matplotlib\testing\decorators.py", > line 126, in decorated_compare_images > '(RMS %(rms).3f)'%err) > ImageComparisonFailure: images not close: > D:\works\matplotlibTest\result_images\test_mathtext\mathtext_stix.png > vs. D:\works\matplotlibTest\result_images\test_mathtext\expected-mathtext_stix.png > (RMS 29.816) > > ====================================================================== > ERROR: matplotlib.tests.test_mathtext.test_mathtext_stixsans > ---------------------------------------------------------------------- > Traceback (most recent call last): > File "C:\Python26\lib\site-packages\nose-0.11.4-py2.6.egg\nose\case.py", > line 186, in runTest > self.test(*self.arg) > File "C:\Python26\lib\site-packages\matplotlib\testing\decorators.py", > line 32, in failer > result = f(*args, **kwargs) > File "C:\Python26\lib\site-packages\matplotlib\testing\decorators.py", > line 126, in decorated_compare_images > '(RMS %(rms).3f)'%err) > ImageComparisonFailure: images not close: > D:\works\matplotlibTest\result_images\test_mathtext\mathtext_stixsans.png > vs. D:\works\matplotlibTest\result_images\test_mathtext\expected-mathtext_stixsans.png > (RMS 21.471) > > ---------------------------------------------------------------------- > Ran 150 tests in 100.386s > |