Many thanks for your reply and suggestions. I see what
> is happening. Nearest neighbor interpolation has the
> colors right, but i was trying to get "more
> interpolation". I guess looking at the great pictures
> that imshow() produces i was hoping for a result such
> as that of
> X = rand(10) pcolor( X ) shading 'interp'
As far as I recall, matlab's pcolor also loses an edge due to
interpolation. Perhaps the main difference is that in matlab, the
axes limits are set by default so that you don't see it. I remember
being surprised by this many moons ago the first time I used pcolor in
> in Matlab. The Matplotlib picture is just as good
> really, except for the border. Why are the other
> borders not white as well? Is the interpolation
> "directional"? Why aren't pixels on the border only
> interpolated with their neighbors inside the image, and
> not those outside (these have less neighbors than
> pixels in the middle)?
I'll have to think about this some more.
There is also something funny about how the tick labeling currently
works for images, because the X[0,0] coord is upper left but is
labeled as 0,10. Perhaps ticks should be off be default, or labeled
with the y axis descending. Those who have opinions please weigh in.
BTW, the developer of agg, Maxim, is fairly responsive, so if you want
to pursue this issue after reading some of the code I point to below
on the agg mailing list
Maxim can probably provide some additional guidance.
> Perhaps you can point me to the part of the code (c++ i
> assume) which does the interpolation? Should i grab the
> CVS repository for that? Then maybe i can play around
> and see if i can achieve the effect i am looking for.
The code is available in the matplotlib src distribution. The module
is src/_image.cpp, which uses agg for image manipulation; see the
function Image_resize. All the agg code is also in the matplotlib src
distro, eg, agg2/include. agg2 doesn't have a lot of documentation -
hence I spend a lot of time reading src files, eg
The latest agg snapshot it http://www.antigrain.com/agg2.tar.gz which
has lots of examples in the examples dir. Agg can do a lot with
images, some of which would be nice to add to the matplotlib