Screenshot instructions:
Windows
Mac
Red Hat Linux
Ubuntu
Click URL instructions:
Rightclick on ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)
From: Suresh Pillai <stochashtic@ya...>  20070402 19:27:02

So I been using the log scale provided by matplotlib.colors.LogNorm, but have been seing bizarre behaviour. Basically, high values are not displayed properly. I give simple examples below with just two possible values in the matrix, but all the same issues arise with more varied values. First notice that the high value (100000) is displayed as being of value=1: from pylab import * from matplotlib.colors import LogNorm matrix = ones((30,30)) matrix = matrix*440 matrix[29,29] = 100000 matshow(matrix, norm=LogNorm(vmin=1, vmax=1000000)) colorbar() show() The cutoff value for incorrect display (for the scale I am using) seems to be at 32000: from pylab import * from matplotlib.colors import LogNorm matrix = ones((30,30)) matrix = matrix*440 matrix[29,29] = 32000 matshow(matrix, norm=LogNorm(vmin=1, vmax=1000000)) colorbar() show() However, if the value is really high, the color displayed changes again, although still not to the correct color (please try with values 918000, 920000, and 999000 to see see it progress): from pylab import * from matplotlib.colors import LogNorm matrix = ones((30,30)) matrix = matrix*440 matrix[29,29] = 918000 matshow(matrix, norm=LogNorm(vmin=1, vmax=1000000)) colorbar() show() And if one specifies no limits to LogNorm, the colorbar displayed is incomplete and the colour displayed is wrong in a different way then when specifying the limits (try value = 999000 as well). from pylab import * from matplotlib.colors import LogNorm matrix = ones((30,30)) matrix = matrix*440 matrix[29,29] = 918000 matshow(matrix, norm=LogNorm()) colorbar() show() Either I am completely missing something or there is a major bug. I am using mpl checked out from svn on 26 March. Thanks, Suresh 
From: Eric Firing <efiring@ha...>  20070402 20:07:41

I see where the problem (or at least one problem) is, and I will try to get it fixed by tomorrow. In the meantime, I think you will get the results you want by simply converting your arrays to floating point: matshow(matrix.astype(float), ...) Eric Suresh Pillai wrote: > So I been using the log scale provided by matplotlib.colors.LogNorm, but > have been seing bizarre behaviour. Basically, high values are not > displayed properly. I give simple examples below with just two possible > values in the matrix, but all the same issues arise with more varied > values. > > First notice that the high value (100000) is displayed as being of > value=1: > > from pylab import * > from matplotlib.colors import LogNorm > > matrix = ones((30,30)) > matrix = matrix*440 > matrix[29,29] = 100000 > > matshow(matrix, norm=LogNorm(vmin=1, vmax=1000000)) > colorbar() > show() > > The cutoff value for incorrect display (for the scale I am using) seems to > be at 32000: > > from pylab import * > from matplotlib.colors import LogNorm > > matrix = ones((30,30)) > matrix = matrix*440 > matrix[29,29] = 32000 > > matshow(matrix, norm=LogNorm(vmin=1, vmax=1000000)) > colorbar() > show() > > However, if the value is really high, the color displayed changes again, > although still not to the correct color (please try with values 918000, > 920000, and 999000 to see see it progress): > > from pylab import * > from matplotlib.colors import LogNorm > > matrix = ones((30,30)) > matrix = matrix*440 > matrix[29,29] = 918000 > > matshow(matrix, norm=LogNorm(vmin=1, vmax=1000000)) > colorbar() > show() > > And if one specifies no limits to LogNorm, the colorbar displayed is > incomplete and the colour displayed is wrong in a different way then when > specifying the limits (try value = 999000 as well). > > from pylab import * > from matplotlib.colors import LogNorm > > matrix = ones((30,30)) > matrix = matrix*440 > matrix[29,29] = 918000 > > matshow(matrix, norm=LogNorm()) > colorbar() > show() > > > Either I am completely missing something or there is a major bug. > > I am using mpl checked out from svn on 26 March. > > Thanks, > Suresh > >  > 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 surveysand earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > Matplotlibusers mailing list > Matplotlibusers@... > https://lists.sourceforge.net/lists/listinfo/matplotlibusers 
From: Eric Firing <efiring@ha...>  20070402 22:12:18

Suresh Pillai wrote: > Thanks. Suspected as much re integer vs float. > > Which brings me to the question: if we are able to debug issues > ourselves, should we just post to this list or the devel list or > contribute privately. Definitely to one of the lists. If you think other users may be interested in the bug, or may have seen it and may have a solution, then post to the users list. I expect this will usually be the case. But (for example) if you see something in the code that you think should be done differently, but is not causing immediate problems, then you might want to post that the the devel list instead, on the grounds that it would not be of interest to users who are not also devel subscribers. Eric > > Thanks, > Suresh 
From: Eric Firing <efiring@ha...>  20070403 08:28:53

I think the problems with imshow and matshow of integer arrays are fixed now in svn. Eric Suresh Pillai wrote: > So I been using the log scale provided by matplotlib.colors.LogNorm, but > have been seing bizarre behaviour. Basically, high values are not > displayed properly. I give simple examples below with just two possible > values in the matrix, but all the same issues arise with more varied > values. > > First notice that the high value (100000) is displayed as being of > value=1: > > from pylab import * > from matplotlib.colors import LogNorm > > matrix = ones((30,30)) > matrix = matrix*440 > matrix[29,29] = 100000 > > matshow(matrix, norm=LogNorm(vmin=1, vmax=1000000)) > colorbar() > show() > > The cutoff value for incorrect display (for the scale I am using) seems to > be at 32000: > > from pylab import * > from matplotlib.colors import LogNorm > > matrix = ones((30,30)) > matrix = matrix*440 > matrix[29,29] = 32000 > > matshow(matrix, norm=LogNorm(vmin=1, vmax=1000000)) > colorbar() > show() > > However, if the value is really high, the color displayed changes again, > although still not to the correct color (please try with values 918000, > 920000, and 999000 to see see it progress): > > from pylab import * > from matplotlib.colors import LogNorm > > matrix = ones((30,30)) > matrix = matrix*440 > matrix[29,29] = 918000 > > matshow(matrix, norm=LogNorm(vmin=1, vmax=1000000)) > colorbar() > show() > > And if one specifies no limits to LogNorm, the colorbar displayed is > incomplete and the colour displayed is wrong in a different way then when > specifying the limits (try value = 999000 as well). > > from pylab import * > from matplotlib.colors import LogNorm > > matrix = ones((30,30)) > matrix = matrix*440 > matrix[29,29] = 918000 > > matshow(matrix, norm=LogNorm()) > colorbar() > show() > > > Either I am completely missing something or there is a major bug. > > I am using mpl checked out from svn on 26 March. > > Thanks, > Suresh > >  > 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 surveysand earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > Matplotlibusers mailing list > Matplotlibusers@... > https://lists.sourceforge.net/lists/listinfo/matplotlibusers 