On 7 June 2011 11:32, Klonuo Umom <klo...@gmail.com> 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]

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

------------------------------------------------------------------------------
EditLive Enterprise is the world's most technically advanced content
authoring tool. Experience the power of Track Changes, Inline Image
Editing and ensure content is compliant with Accessibility Checking.
http://p.sf.net/sfu/ephox-dev2dev
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to