Hi ,

The example below seems to do what you want, but I'm not sure if this is the 
favourite way to do it. 

Please notice: the if-statement might not be correct in any case of 
application.

regards Matthias

>----------------------------------------------------------------------------------------------
from matplotlib import rcParams
import matplotlib.pyplot as plt

rcParams['xtick.direction'] = 'out'
rcParams['ytick.direction'] = 'out'

fig = plt.figure()
ax = fig.add_subplot(111)

# run through all lines drawn for xticks and yticks
for i, line in enumerate(ax.get_xticklines() + ax.get_yticklines()):
    if i%2 == 1:   # odd indices
        line.set_visible(False)

plt.show()
>--------------------------------------------------------------------------------------

On Wednesday 04 March 2009 01:56:07 per freem wrote:
> hi all,
>
> i have the following plot:
>
> rcParams['xtick.direction'] = 'out'
> rcParams['ytick.direction'] = 'out'
> scatter(x, y)
>
> this changes the tick directions to be out. how can i make it so only the
> ticks on the x axis and y axis appear? i.e. remove the ticks that are in
> the top axis (the one parallel to the x-axis) and in the right most axis
> (the one parallel to the y-axis)?
>
> thanks.



------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to