On Monday 29 March 2010 19:53:00 yogesh karpate wrote:
> Dear All,
>                  I want to make minor ticks working in following program.
> Here only major ticks are dis[played in grpah though i have declared the
> minor ticks
> minorticks_on() doesnt work in my code. How to fix that.Please help me
> out.Thanks in advance !!!!!!!!!!!!'
> Regards
> Yogesh
>
> from numpy import *
> from scipy import *
> from scipy import signal, misc
> import sys,time,os,gc
> import matplotlib
> import matplotlib.pyplot as plt
> from numpy.random import *
> from pylab import plot, show, ylim, yticks,xlim
> from pylab import *
> x=loadtxt('/home/jaguar/Desktop/45.txt')
> x=x[0:1399]
> y=arange(len(x))
> plt.figure(2)
> plt.plot(y,x,'k-')
> #minorticks_on()
> grid(True)#, color="r", ls="-")
> gca().xaxis.grid(True, which="minor", color="r")
> #gca().yaxis.grid(True, which='minor')
> #grid(True, which="minor", color="r")
>
> show()#l

Hi Yogesh,

using plt.minorticks_on() and plt.grid(True, which="majorminor", color="r") 
works for me (with matplotlib-svn).

If minorticks_on() doesn't work for you, you could set the location of the 
minor ticks on your own as in my attached code or the examples:
http://matplotlib.sourceforge.net/examples/pylab_examples/major_minor_demo1.html
http://matplotlib.sourceforge.net/examples/pylab_examples/major_minor_demo2.html

Kind regards,
Matthias

Attachment: minor_ticks.py
Description: application/python

------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to