Custom tick labels for mplot3D

Hi All,

I was wondering how to set custom tick labels in an mplot3D plot? I have tried:

ax = Axes3D(figure)

ax.set_xticks(ticks,labels)

  • and -

ax = Axes3D(figure)

ax.w_xaxis.set_ticks(ticks,labels)

and both options cause the plot to disappear from the viewing window.

When I don’t try to set ticks, the window shows up fine except for the fact that it displays the axis values -120.1, -120.5, -120.7 as -0.1, -0.5, -0.7, which isn’t going to work for me. I need a way to force the plot to display the values exactly as they are written.

Many thanks in advance,

Katie

Which version of mpl are you using? Note that there have been huge advances in usability for the recently released v1.1.0. Many of the same functions you would normally use in regular plots are now available for mplot3d, and the need to use w_xaxis and such is going away.

Ben Root

···

On Monday, October 31, 2011, Katie Boyle <katielboyle@…287…> wrote:

Hi All,
I was wondering how to set custom tick labels in an mplot3D plot? I have tried:

ax = Axes3D(figure)
ax.set_xticks(ticks,labels)

  • and -
    ax = Axes3D(figure)
    ax.w_xaxis.set_ticks(ticks,labels)
    and both options cause the plot to disappear from the viewing window.

When I don’t try to set ticks, the window shows up fine except for the fact that it displays the axis values -120.1, -120.5, -120.7 as -0.1, -0.5, -0.7, which isn’t going to work for me. I need a way to force the plot to display the values exactly as they are written.

Many thanks in advance,
Katie