From: John H. <jdh...@ac...> - 2004-12-30 02:59:55
|
>>>>> "seberino" == seberino <seb...@sp...> writes: seberino> It seems if your grid has 20 rows ( different y values) seberino> of points that you won't get 20 colored horizontal seberino> strips but rather *19*. This is because we must lose seberino> one row to specify the top and/or bottom EDGE of the seberino> plot.... so XX rows means (XX-1) rows of colored seberino> squares. yep that's right, a frequent source of confusion. seberino> Please tell me if this is right but more importantly, seberino> how to most wisely remove the white horizontal strip seberino> from this pcolor plot. Well it would help if you posted your code, but my guess is that you need to set your axis limits to equal your ymin/ymax of the pcolor. Perhaps this example will give you a hint >>> pcolor(rand(10,7)) # no white strip... >>> ylim(0,11) # a white strip because the ylim is wrong In essence, the axis autoscaler will round up, eg 4990 to 5000, to make nice integer ticks. With pcolors and images, you often don't want this, so use the axis, xlim, and/or ylim commands to set the limits properly. Eg ymin = min(ravel(Y)) ymax = max(ravel(Y)) ylim(ymin, ymax) Also, if your x and y grids are equally spaced, you'll get much better performance for large arrays, as well as more interpolation options, if you use imshow with the extent kwarg to set the extent of your image data. JDH |