[SciPy-User] [matplotlib] xgrid on values of x-variable?

This is a question for the Matplotlib list
(matplotlib-users List Signup and Options).

In any case, this should do what you want:

import numpy as np
import matplotlib.pyplot as plt

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

ax.plot(range(5))

ticks = [1.2, 2.3, 3.1, 4]
ax.xaxis.set_ticks(ticks)
ax.xaxis.grid()

plt.show()

Cheers,
Scott

···

On 7 June 2011 11:32, Klonuo Umom <klonuo@...287...> wrote:

I have very simple XY graph, and I want to display X grid only, and only
on values of X variable, which are lets say [10, 11, 12, 15, 20]

Hello,

I've got following function describing any kind of animal dispersal kernel:

def pdf(x,s1,s2):
    return (p/(math.sqrt(2*math.pi*s1**2))*numpy.exp(-((x-0)**(2)/(2*s1**(2)))))+((1-p)/(s2*math.sqrt(2*math.pi))*numpy.exp(-((x-0)**(2)/(2*s2**(2)))))

On the other hand I've got data from literature with which I want to fit the function so that I get s1, s2 and x.
Ususally the data in the literature are as follows:

Example 1: 50% of the animals are between -270m and +270m and 90% are between -500m and + 500m

Example 2: 84% is between - 5000 m and +5000m, and 73% are between -1000m and +1000m

So far as I understand an integration of the function is needed to solve for s1 and s2 as all the literature data give percentage (area under the curve) Can that be used to fit the curve or can that create ranges for s1 and s2.

/Johannes

···

--
NEU: FreePhone - kostenlos mobil telefonieren!
Jetzt informieren: http://www.gmx.net/de/go/freephone