irregular grid of points: how to set figure pixel dimension ?

Hi all,
I want to plot an irregular grid of points with x coordinates that can assume
values between 0 and 13216 and y coordinates that can assume values between
0 and 8985 on a transparent canvas and save it as a .png file.
I use Agg backend.
I would like than to superimpose the obtained .png image over another image
(not obtained with matplotlib and not with python) of 13217 x 8986 pixels.
This because the irregular grid points of the first image are pixels of the
second image.
I have write this script where

samples = 13217
lines = 8986
dpi = 100
xvect and yvect 2 numpy vectors that i have to convert to lists.

# data aspect ratio
data_aspect_ratio = samples / float(lines)
# figure axis inches dimension
x_axis_inches = lines / float(dpi)
y_axis_inches = data_aspect_ratio * x_axis_inches
# drawing figure canvas
figure_label = p.figure(facecolor = 'w', edgecolor = 'w',
figsize=(x_axis_inches, y_axis_inches), frameon = False)
# main axes enlarging to fill all vanvas
main_axes = p.axes([0, 0, 1, 1])
# plot grid
points_1 = p.plot(xvect.tolist(), yvect.tolist(), 'D')
# grid setting properties
p.setp(points_1, markersize = 30, markeredgecolor = 'b', markerfacecolor
= 'None', markeredgewidth = 7)
main_axes.axis([0, lines, 0, samples])
# transparence
main_axes.axesPatch.set_alpha(0.0)
# deleting asix ticks
p.setp(main_axes, xticks = [], yticks = [])
# reversing y axis
y_reversing = main_axes.set_ylim(main_axes.get_ylim()[::-1])
# image saving
p.savefig(out_image_file, dpi = dpi)
# closing figure
p.close(figure_label)

The problem is that i obtain a .png image of 13216 x 8985 pixels and not of
13217 x 8986 pixels as i planned. What can it be the problem ?
Thank you all.

ยทยทยท

--
--
Emanuele Passera