From: Luis Q. <lui...@gm...> - 2010-10-25 07:59:55
|
On 25/10/2010 01:15, Benjamin Root wrote: > On Mon, Oct 18, 2010 at 8:52 AM, Luis Quesada <l.q...@4c... > <mailto:l.q...@4c...>> wrote: > > Dear all, > > Is there a way of avoiding the overlap between the text of the labels > and the text of the ticks? This is what I am getting: > > http://4c.ucc.ie/~lquesada/tmp/surface.pdf > <http://4c.ucc.ie/%7Elquesada/tmp/surface.pdf> > > Currently I am only doing this: > > ax.set_xlabel('Distance',fontsize=16) > ax.set_ylabel('Size',fontsize=16) > ax.set_zlabel('Cost',fontsize=16) > > Is it also possible to give an orientation to the labels? It would be > nicer if they are oriented parallel to the axis.. > Thanks in advance for your advice! > Cheers, > Luis > > > Luis, > > This is a problem with matplotlib, even in 2d space. It becomes even > more difficult to deal with in 3d projections. One thing that works > in 2d space is to specify the 'x' or 'y' value of the label. I have > never tried this in 3d though, and I don't know what to do for the > zlabel. Anyway, try this for a spin: > > ax.set_xlabel('Distance', fontsize=16, y=0.05) > ax.set_ylabel('Size', fontsize=16, x=0.05) > ax.set_zlabel('Cost', fontsize=16) > > If it seems to have an effect, then you can tweak the numbers > accordingly to your liking. > > As for having the text have a particular rotation orientation, I am > not aware of any feature to be able to properly control that. If we > could ever get an OpenGL backend (one can dream, can't he?), then I > can see it being possible, but not now in our current framework. > > Ben Root > Thanks a lot Ben. I will play the 'x' and 'y' values of the label then. Cheers, Luis |