This is a question for the Matplotlib list

(https://lists.sourceforge.net/lists/listinfo/matplotlib-users).

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]