plots do not scale to size

Dear all.

When I run the script below, the xlabel and ylabel do not show up. If I increase the figure size, it all works fine. If I open the file in Adobe Illustrator, the x and ylabels are both there, but outside the canvas (or bounding box or whatever it is called). I believe this must be a bug?

I moved my matplotlibrc file out of its usual location to make sure I don't have any funny settings which screws things up. I also deleted the tex cache to avoid any tex-related problems.

Best regards,
Paul.

test.pdf (16.8 KB)

···

######################
import matplotlib
matplotlib.rcParams['figure.figsize'] = [2.85, 2.20]
matplotlib.use('pdf')
from pylab import *

xs = linspace(0, 2 * pi)
ys = sin(xs)
plot(xs, ys)
xlabel(r'$T_{est}$')
ylabel('y axis')

savefig('test')
show()

Hi Paul,

I am not sure if it is a bug. But, it is usual that such a thing
happens when you are making small figures (like in your case).

Try adjusting the following parameters in your rc file, in particular
increase the left space.
# The figure subplot parameters. All dimensions are fraction of the
# figure width or height
#figure.subplot.left : 0.125 # the left side of the subplots of the figure
#figure.subplot.right : 0.9 # the right side of the subplots of the figure
#figure.subplot.bottom : 0.1 # the bottom of the subplots of the figure
#figure.subplot.top : 0.9 # the top of the subplots of the figure
#figure.subplot.wspace : 0.2 # the amount of width reserved for
blank space between subplots
#figure.subplot.hspace : 0.2 # the amount of height reserved for
white space between subplots

The other thing that you can try is to decrease the font size of the
axis labels.

It would be nice if we can rescale the left, right spacing depending
on the figure size.

Cheers,
Chaitanya

···

On Tue, Jun 9, 2009 at 12:05 PM, Paul Anton Letnes<paul.anton.letnes@...287...> wrote:

Dear all.

When I run the script below, the xlabel and ylabel do not show up. If I
increase the figure size, it all works fine. If I open the file in Adobe
Illustrator, the x and ylabels are both there, but outside the canvas (or
bounding box or whatever it is called). I believe this must be a bug?

I moved my matplotlibrc file out of its usual location to make sure I don't
have any funny settings which screws things up. I also deleted the tex cache
to avoid any tex-related problems.

Best regards,
Paul.
######################
import matplotlib
matplotlib.rcParams['figure.figsize'] = [2.85, 2.20]
matplotlib.use('pdf')
from pylab import *

xs = linspace(0, 2 * pi)
ys = sin(xs)
plot(xs, ys)
xlabel(r'T\_\{est\}')
ylabel('y axis')

savefig('test')
show()

------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing
server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
matplotlib-users List Signup and Options