displaying ticklabels on a graph

I run this code, but labels do not appear under the ticks.

      # label the X ticks with years
      self.mpl.canvas.ax.set_xticks(np.arange(len(years))+width/2,
[int(year) for year in years])
      self.mpl.canvas.ax.set_xticklabels([str(year) for year in years])

I Need an help.

Thanks.

···

--
View this message in context: http://old.nabble.com/displaying-ticklabels-on-a-graph-tp31484414p31484414.html
Sent from the matplotlib - devel mailing list archive at Nabble.com.

Could you post a complete, free-standing example that we can run that
exposes your problem?

···

On Wed, Apr 27, 2011 at 4:17 AM, Clyng11 <coulibalynaga@...450...> wrote:

I run this code, but labels do not appear under the ticks.

 \# label the X ticks with years
 self\.mpl\.canvas\.ax\.set\_xticks\(np\.arange\(len\(years\)\)\+width/2,

[int(year) for year in years])
self.mpl.canvas.ax.set_xticklabels([str(year) for year in years])

I Need an help.

Also enclosed the csv file I use. I work with Qt4 and Quantum GIS.

Thanks,

Naga

population.csv (353 Bytes)

···

De : John Hunter <jdh2358@…149…>
À : Clyng11 <coulibalynaga@…450…>
Cc : matplotlib-devel@lists.sourceforge.net
Envoyé le : Sam 30 avril 2011, 22h 45min 22s
Objet : Re: [matplotlib-devel] displaying ticklabels on a graph

On Wed, Apr 27, 2011 at 4:17 AM, Clyng11 <coulibalynaga@…450…> wrote:

I run this code, but labels do not appear under the ticks.

 # label the X ticks with years
 self.mpl.canvas.ax.set_xticks(np.arange(len(years))+width/2,

[int(year) for year in years])
self.mpl.canvas.ax.set_xticklabels([str(year) for year in years])

I Need an help.

Could you post a complete, free-standing example that we can run that
exposes your problem?