Ticks direction

Hi all,

Is it possible to set direction (in or out) individually for each tick. I know about the rc setting ("(x/y)tick.direction") , but I need a finer control over the ticks.

Thanks,

Bartek

A quick (and not safe) way w/ mpl v1.0 is,

    ax = plt.subplot(111)
    ax.plot(np.arange(3))

    ax.set_xticks([0, 0.5, 1., 1.5, 2.])

    mytick = ax.xaxis.majorTicks[2]
    mytick._apply_params(tickdir="out")

I don't think there is a way to do this only using public apis.
I myself actually prefer to create a separate axis (or axes), but this
will be more trickier than above solution.

Regards,

-JJ

···

On Tue, Nov 2, 2010 at 4:22 AM, Bartosz Telenczuk <b.telenczuk@...2786...> wrote:

Hi all,

Is it possible to set direction (in or out) individually for each tick. I know about the rc setting ("(x/y)tick.direction") , but I need a finer control over the ticks.

Thanks,

Bartek

------------------------------------------------------------------------------
Nokia and AT&T present the 2010 Calling All Innovators-North America contest
Create new apps & games for the Nokia N8 for consumers in U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store
http://p.sf.net/sfu/nokia-dev2dev
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
matplotlib-users List Signup and Options

A quick (and not safe) way w/ mpl v1.0 is,

     ax = plt.subplot(111)
     ax.plot(np.arange(3))

     ax.set_xticks([0, 0.5, 1., 1.5, 2.])

     mytick = ax.xaxis.majorTicks[2]
     mytick._apply_params(tickdir="out")

I don't think there is a way to do this only using public apis.
I myself actually prefer to create a separate axis (or axes), but this
will be more trickier than above solution.

Each tick is a Line2D consisting of a single marker, so it is possible to change the marker after the tick has been created:

ax = plt.subplot(1,1,1)
ticks = ax.xaxis.get_majorticklines()
mytick = ticks[3]
mytick.set_marker(2)
plt.draw()

This will flip the first tick on the top border (the one for 0.2).
left, right, up, down are 0, 1, 2, 3.

Eric

···

On 11/02/2010 03:18 PM, Jae-Joon Lee wrote:

Regards,

-JJ

On Tue, Nov 2, 2010 at 4:22 AM, Bartosz Telenczuk > <b.telenczuk@...2786...> wrote:

Hi all,

Is it possible to set direction (in or out) individually for each tick. I know about the rc setting ("(x/y)tick.direction") , but I need a finer control over the ticks.

Thanks,

Bartek

------------------------------------------------------------------------------
Nokia and AT&T present the 2010 Calling All Innovators-North America contest
Create new apps& games for the Nokia N8 for consumers in U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store
http://p.sf.net/sfu/nokia-dev2dev
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
matplotlib-users List Signup and Options

------------------------------------------------------------------------------
Achieve Improved Network Security with IP and DNS Reputation.
Defend against bad network traffic, including botnets, malware,
phishing sites, and compromised hosts - saving your company time,
money, and embarrassment. Learn More!
http://p.sf.net/sfu/hpdev2dev-nov
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
matplotlib-users List Signup and Options

ax = plt.subplot(1,1,1)
ticks = ax.xaxis.get_majorticklines()
mytick = ticks[3]
mytick.set_marker(2)
plt.draw()

Cool! That's what I have been looking for. Thanks so much for your help.

Regards,

Bartek