Dear all,

I find it incredibly hard to work with tick labels in matplotlib (on  
matplotlib 0.98 @ OS X  10.5.4) (It might well be that I haven't  
stumbled across the right solution yet and it is really easy ;-) ). I  
want to first of all change the axis so it displays the normal number  
as ticks and not 0, 1 ,2 ,3 + 6.35e5 or something. I managed that by  
reading the ticks and then converting it to strings and use the  
set_ticklabels to get that. The second thing is that I want to make  
the font smaller, e. g. to 'x-small' at the moment I am using a for  
loop to loop through all xticklabels which is allright but imho looks  
to complicated to do something as simple as that.
I also want to change the padding between the axis and the labels, but  
all my attempts at finding the set_pad method have failed because none  
of the axis objects I could think of had that method.
So here's my workaround for the first two things (each subplot is one  
small window of 6 subplots):

#preparing the subplots()
figure=gcf()
subplots=[]

for i in range(6):
     subplots.append(figure.add_subplot(23*10+i+1))


for i,line in enumerate(line_data):
     subplots[i].axes.ticklabel_format(style='sci',axis='x')
     subplots[i].plot(line[:,0],line[:,1])
     new_ticks=map(str,subplots[i].axes.get_xticks())
     subplots[i].axes.set_xticklabels(new_ticks)
     for ilabel in subplots[i].axes.get_xticklabels():
         ilabel.set_fontsize('x-small')


----------------------
Oh and while I'm at it: Is there a function that plots a two  
dimensional array?

Thanks in advance
      Wolfgang

P.S.: I already looked through the mailing list for the padding issue  
but it only mentioned set_pad which I could not find

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to