Width of tick lines

Hello,

I am looking for an way to set the width of the tick lines in a plot. I have not found any rc parameter for this.

Doing:

plot(...)
c=gca()
tl=c.get_ticklines()

gives a list of tickline objects. Every tickline object has a method tl[0].set_linewidth(). Calling this method with different float parameters seems to have no effect.

Thanks for any hint on this,
  Torsten.

Torsten Hahn wrote:

Hello,

I am looking for an way to set the width of the tick lines in a plot. I have not found any rc parameter for this.

Good point; it does seem to be a gap in the configurability.

Doing:

plot(...)
c=gca()
tl=c.get_ticklines()

gives a list of tickline objects. Every tickline object has a method tl[0].set_linewidth(). Calling this method with different float parameters seems to have no effect.

Use tl[0].set_markeredgewidth(); ticks are implemented as markers now to take advantage of backend optimization of marker rendering. No, this is not obvious!

Eric

Torsten Hahn wrote:

Hello,
I am looking for an way to set the width of the tick lines in a plot. I have not found any rc parameter for this.

Good point; it does seem to be a gap in the configurability.

Would be nice to have sopmething added in a future release.

Doing:
plot(...)
c=gca()
tl=c.get_ticklines()
gives a list of tickline objects. Every tickline object has a method tl[0].set_linewidth(). Calling this method with different float parameters seems to have no effect.

Use tl[0].set_markeredgewidth(); ticks are implemented as markers now to take advantage of backend optimization of marker rendering. No, this is not obvious!

Ok that works but i run into another problem. If you use log or loglog plots e.g.

ax = py.subplot(111)
ax.loglog(data)
xtl = ax.get_xticklines()
ytl = ax.get_yticklines()

xtl and ytl are now lists with 2 entrys, one for every axis (for xtl, top and bottom x-axis).

top_xtl = xtl[1]

The problem is, that there only the major ticklines are returned by ax.get_xticklines(). How do i access (and modify) the minor ticklines?

Torsten.

···

Am 21.08.2007 um 10:30 schrieb Eric Firing:

In [80]: for tick in ax.xaxis.get_major_ticks():
    print tick.tick1line, tick.tick2line
   ....:
Line2D((0,0)) Line2D((0,1))
Line2D((0,0)) Line2D((0,1))
Line2D((0,0)) Line2D((0,1))
Line2D((0,0)) Line2D((0,1))
Line2D((0,0)) Line2D((0,1))
Line2D((0,0)) Line2D((0,1))

In [82]: for tick in ax.xaxis.get_minor_ticks():
    print tick.tick1line, tick.tick2line
   ....:

for the xaxis, tick1line is the left tick, tick2line is the right
tick. for the y axis they are the bottom and top.

Here is the help on the tick attrs:

In [85]: from matplotlib.axis import Tick

In [87]: print Tick.__doc__

    Abstract base class for the axis ticks, grid lines and labels

    1 refers to the bottom of the plot for xticks and the left for yticks
    2 refers to the top of the plot for xticks and the right for yticks

    Publicly accessible attributes

      tick1line : a Line2D instance
      tick2line : a Line2D instance
      gridline : a Line2D instance
      label1 : a Text instance
      label2 : a Text instance
      gridOn : a boolean which determines whether to draw the tickline
      tick1On : a boolean which determines whether to draw the 1st tickline
      tick2On : a boolean which determines whether to draw the 2nd tickline
      label1On : a boolean which determines whether to draw tick label
      label2On : a boolean which determines whether to draw tick label

···

On 8/21/07, Torsten Hahn <torsten.hahn@...1704...> wrote:

The problem is, that there only the major ticklines are returned by
ax.get_xticklines(). How do i access (and modify) the minor ticklines?