Closed 153957 closed 9 years ago
Perhaps this can be fixed now 38854e4b43a2d3604172e785802dd30b89dd9de1
To much work for now. We will leave it as an exercise to the user to manually set the correct width-height ratio.
Hint:
image = Image.open('foo.png')
aspect = float(image.size[0]) / float(image.size[1])
width = .67
height = width / aspect
graph = Plot(width =r'%.2f\linewidth' % width, height=r'%.2f\linewidth' % height)
graph.draw_image(image, 0, 0, image.size[0], image.size[1])
When using draw_image it might be nice if the plot (data area) aspect ratio matches the bitmap. To make the axes fit snugly around the bitmap.
This is not trivial with the width/height keywords, these seem to include ticks or some padding..For Utrecht demo the bitmap is 768x512 (= 3:2), however, the set Plot width and height ratio to get a nice fit are 7:5.
With improper aspect ratio letterboxing (empty plot area within the axes) will occur.