On Mon, Jul 21, 2008 at 4:54 AM, Wolfgang Kerzendorf
<[EMAIL PROTECTED]> wrote:
> 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

Sorry you are having trouble - -suggestions below

> 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

You can also just set your own format string:

  import matplotlib.ticker as ticker
  ax.yaxis.set_major_formatter(ticker.FormatStrFormatter('%1.2f')

> 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.

You can also set the rc parameter

  import matplotlib
  matplotlib.rcParams['ytick.major.size'] = 'x-small'

and likewise for minor ticks.

> 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.

Did you try setting the rc parameter

  matplotlib.rcParams['ytick.major.pad'] =6

An example rc is at http://matplotlib.sf.net/matplotlibrc. You can
drop this in ~/.matplotlib and make these customizations permanent if
you want.

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


ax.imshow plots images

-------------------------------------------------------------------------
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