From: John H. <jdh...@ac...> - 2005-04-09 11:59:31
|
>>>>> "Brian" == Brian B <b-m...@bb...> writes: Brian> Hello, I have generated an image with savefig(..., Brian> dpi=100). I do not use a main title for the graph (not the Brian> same as the X- and Y- axis labels). When I display the Brian> image on an HTML page, there is a space of approximately 60 Brian> pixels above the image that contain no graph drawing, I Brian> assume this space was reserved for a title that I have no Brian> need for. The white space of 60 pixels on top creates too Brian> much gap between the image and another HTML page element Brian> above. Hi Brian, The Axes is the white space that contains the lines, rectangles, text etc. The Figure is the whole canvas that contains the Axes. The default Axes is created by Subplot(111) which leaves empty space at the left, bottom, top, right and bottom. You can create your own Axes dimensions. with the "axes" command http://matplotlib.sf.net/matplotlib.pylab.html#-axes Eg, to leave no room at right or top, use ax = axes([0.1, 0.1, 0.9, 0.9]) The arguments to the axes function are left, bottom, width and height, expressed as fractions of the figure width and height. 0,0 is bottom, left and 1,1 is top, right. So the lower left corner of this axes is 0.1, 0.1 and the upper right is 0.1+0.9, 0.1+0.9 or 1,1 which is the upper right of the figure (no white space). You may also want to customize the background color of the Axes and Figure to be the same -- see help for axes, figure and savefig (hint, although the figure has a background color, savefig overrides it because sometimes you want a different figure background when working interactively and saving). See also examples/axes_demo.py. JDH |