It turned out to be quite simple: I just have to specify the size of the matplotlib figure:
fig = figure.Figure(fig_size=(6, 8), dpi=100)
will generate a plot that is 600 by 800 pixels. Replacing 6 and 8 by the width and height (each divided by the dpi) of the parent canvas solves the problem.
For more information on how to work with exact pixels in matplotlib see Specifying and saving a figure with exact size in pixels