setting x tick labels with matshow

I am trying to create a figure that plots a data matrix with matshow and has x tick labels corresponding to the x dimension of the matrix. The x dimension is a series of floats, but they don't correspond to the data matrix cell index values (0,1,2…) that make up what matplotlib obviously thinks are the x values for the plot. Is there a way that I can set the x tick labels so that they will be laid out and formatted in the normal way for numbers on the x-axis? It would be great if they also scaled in the normal way when the plot is manipulated in the little gui window.

Thanks for the help.

Kelson,

Reading the documentation of matshow
help(matshow)
reveals that it passes most keywords to imshow. Documentation of imshow
help(imshow)
says it has an extent keyword to indicate the x and y ranges (instead of the array index). So something like (untested)
matshow(<your matrix>,extent=(left,right,bottom,top)) #where left is probably min(x), right is max(x), etc.
should work.

-Sterling

···

On Dec 4, 2013, at 5:07PM, Kelson Zawack wrote:

I am trying to create a figure that plots a data matrix with matshow and has x tick labels corresponding to the x dimension of the matrix. The x dimension is a series of floats, but they don't correspond to the data matrix cell index values (0,1,2…) that make up what matplotlib obviously thinks are the x values for the plot. Is there a way that I can set the x tick labels so that they will be laid out and formatted in the normal way for numbers on the x-axis? It would be great if they also scaled in the normal way when the plot is manipulated in the little gui window.

Thanks for the help.
------------------------------------------------------------------------------
Sponsored by Intel(R) XDK
Develop, test and display web and hybrid apps with a single code base.
Download it for free now!
http://pubads.g.doubleclick.net/gampad/clk?id=111408631&iu=/4140/ostg.clktrk
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
matplotlib-users List Signup and Options