## [Matplotlib-users] Changing tick labels

 [Matplotlib-users] Changing tick labels From: Tommy Grav - 2007-08-05 15:23:50 ```I am creating a 2 dimensional histogram that I would like to plot as a contourf plot with matplotlib. I am using numpy to generate the histogram, but when I plot it the tick marks are of course the index of the histogram array. How do I change these tick labels to the value of the bins used to generate the histogram? Cheers Tommy ```

 [Matplotlib-users] Changing tick labels From: Tommy Grav - 2007-08-05 15:23:50 ```I am creating a 2 dimensional histogram that I would like to plot as a contourf plot with matplotlib. I am using numpy to generate the histogram, but when I plot it the tick marks are of course the index of the histogram array. How do I change these tick labels to the value of the bins used to generate the histogram? Cheers Tommy ```
 Re: [Matplotlib-users] Changing tick labels From: Eric Firing - 2007-08-05 18:09:24 ```Tommy, The easiest way is probably to provide contourf with x and y arguments corresponding to the bin centers. The x vector would have an entry for each column in your Z(x,y), and the y vector an entry for each row. In [1]:z = rand(10,20) In [2]:x = 2*arange(20) In [3]:y = 2*arange(10) In [4]:contourf(x,y,z) Eric Tommy Grav wrote: > I am creating a 2 dimensional histogram that I would like to plot as > a contourf plot with > matplotlib. I am using numpy to generate the histogram, but when I > plot it the tick marks > are of course the index of the histogram array. How do I change these > tick labels to > the value of the bins used to generate the histogram? > > Cheers > Tommy > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. > Still grepping through log files to find problems? Stop. > Now Search log events and configuration files using AJAX and a browser. > Download your FREE copy of Splunk now >> http://get.splunk.com/ > _______________________________________________ > Matplotlib-users mailing list > Matplotlib-users@... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users ```