From: John H. <jdh...@ac...> - 2006-03-14 16:34:59
|
>>>>> "John" == John Hunter <jdh...@ac...> writes: >>>>> "Yogesh" == Yogesh Wadadekar <wad...@st...> writes: Yogesh> Hi, Yogesh> I encounter problems with the solution below. My test case Yogesh> from yesterday was really not a 'test case' because both Yogesh> images had near identical values. Thus, the auto vmin,vmax Yogesh> settings were the same in both images. John> I think the difference we are seeing may due to the fact John> that the norm attributes are not set until the figure is John> drawn. So in a script with interactive off, the vmin and John> vmax attrs are not updated from None to their True values. John> You can fix this either by working in interactive mode or by John> forcing a draw Here is a more elegant solution: you don't need to force a draw, you just need to force an autoscale (which draw does) from pylab import imshow, rand, show im = imshow(rand(10,10)) im.autoscale() print im.norm.vmin, im.norm.vmax Now you can pass the vmin and vmax attrs to your new image and expect them to work. FYI, in your case before when you were passing None, imshow interprets None to mean "autoscale". JDH |