x,y ticklabel too close

Hello list,

For the following plotI using a large font for the tick-label that causes the first x,y tick-labels to overlap

http://yfrog.com/5zimageykp

for now I’m padding spaces to “fix” the plot, like this:

newtick = ["-10 ", "-5 ", "0 ", "5 ", "10 "]
pos =[-10, -5, 0, 5, 10]
yticks(pos, newtick)

However I was wondering if there is any automatic way to avoid or fix this overlap.

Thanks, Filipe

Hi,

11/02/10 @ 12:40 (-0500), thus spake Filipe Pires Alvarenga Fernandes:

Hello list,

For the following plotI using a large font for the tick-label that causes
the first x,y tick-labels to overlap

http://yfrog.com/5zimageykp

for now I'm padding spaces to "fix" the plot, like this:

newtick = ["-10 ", "-5 ", "0 ", "5 ", "10 "]
pos =[-10, -5, 0, 5, 10]
yticks(pos, newtick)

However I was wondering if there is any automatic way to avoid or fix this
overlap.

Not that I'm aware of, other than changing the font size, or
the axis limits.

···

Thanks, Filipe

------------------------------------------------------------------------------
SOLARIS 10 is the OS for Data Centers - provides features such as DTrace,
Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW
http://p.sf.net/sfu/solaris-dev2dev

_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

The current matplotlib does not have any automatic way as far as I
know (any contribution will be appreciated).

On the other hand, instead of explicitly specifying the ticks and
ticklabels, you may try to reduce the number of ticks.

gca().xaxis.get_major_locator()._nbins=4

Regards,

-JJ

···

On Thu, Feb 11, 2010 at 12:40 PM, Filipe Pires Alvarenga Fernandes <ocefpaf@...287...> wrote:

Hello list,

For the following plotI using a large font for the tick-label that causes
the first x,y tick-labels to overlap

http://yfrog.com/5zimageykp

for now I'm padding spaces to "fix" the plot, like this:

newtick = ["-10 ", "-5 ", "0 ", "5 ", "10 "]
pos =[-10, -5, 0, 5, 10]
yticks(pos, newtick)

However I was wondering if there is any automatic way to avoid or fix this
overlap.

Thanks, Filipe

------------------------------------------------------------------------------
SOLARIS 10 is the OS for Data Centers - provides features such as DTrace,
Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW
http://p.sf.net/sfu/solaris-dev2dev
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

This is also not automatic, and maybe more work than it's worth, but
could it be helpful to use spines, as shown in the example down the
page a bit here:

http://matplotlib.sourceforge.net/users/whats_new.html

It seems there would be no way for the numbers to overlap if spines
were used this way.

Che

···

On Thu, Feb 11, 2010 at 12:40 PM, Filipe Pires Alvarenga Fernandes <ocefpaf@...287...> wrote:

Hello list,

For the following plotI using a large font for the tick-label that causes
the first x,y tick-labels to overlap

http://yfrog.com/5zimageykp

for now I'm padding spaces to "fix" the plot, like this:

newtick = ["-10 ", "-5 ", "0 ", "5 ", "10 "]
pos =[-10, -5, 0, 5, 10]
yticks(pos, newtick)

However I was wondering if there is any automatic way to avoid or fix this
overlap.

Thanks, Filipe

Thanks for all the suggestions,

Spines did the trick.

JJ, I would like to be able to contribute more, but my python knowledge is very limited and I’m still a very Matlab oriented person.

Anyways, maybe people here might be interested in my recent adventure trying to learn python. I converted the CSIRO seawater library from matlab to python.

http://www.cmar.csiro.au/datacentre/ext_docs/seawater.htm

I know that this is specific for oceanographers, but I saw some of us in this list.

Thanks again, this list helped my a lot.

···

On Thu, Feb 11, 2010 at 12:40 PM, Filipe Pires Alvarenga Fernandes <ocefpaf@…287…> wrote:

Hello list,

For the following plotI using a large font for the tick-label that causes the first x,y tick-labels to overlap

http://yfrog.com/5zimageykp

for now I’m padding spaces to “fix” the plot, like this:

newtick = ["-10 ", "-5 ", "0 ", "5 ", "10 "]
pos =[-10, -5, 0, 5, 10]
yticks(pos, newtick)

However I was wondering if there is any automatic way to avoid or fix this overlap.

Thanks, Filipe