title: 3D Plot with Matplotlib: Hide axes but keep axis-labels?
body: <p>I am using Matplotlib to visualize three-dimensional arrays.
  I got it almost the way I want it, apart from a minor snag... see the illustration and the description below of what I can get it to do and what I want it to do...</p>
  
  <ol>
  <li>Show a bunch of cubes with labels, but also a bunch of other stuff.</li>
  <li>Show a bunch of cubes but no axis-labels.</li>
  <li>This is what I want but cannot get it to do... I want to display a bunch of cubes WITH axis-labels but nothing else.</li>
  </ol>
  
  <p><img src="https://i.stack.imgur.com/YblUt.png" alt="enter image description here"></p>
  
  <p>I hope you guys can help me out :) See the source below.</p>
  
  <pre><code>from mpl_toolkits.mplot3d import axes3d
  import matplotlib.pyplot as plt
  from matplotlib import rcParams
  import numpy as np
  rcParams['axes.labelsize'] = 14
  rcParams['axes.titlesize'] = 16
  rcParams['xtick.labelsize'] = 14
  rcParams['ytick.labelsize'] = 14
  rcParams['legend.fontsize'] = 14
  rcParams['font.family'] = 'serif'
  rcParams['font.serif'] = ['Computer Modern Roman']
  rcParams['text.usetex'] = True
  rcParams['grid.alpha'] = 0.0
  
  def make_cube():
      """ A Cube consists of a bunch of planes..."""
  
      planes = {
          "top"    : ( [[0,1],[0,1]], [[0,0],[1,1]], [[1,1],[1,1]] ),
          "bottom" : ( [[0,1],[0,1]], [[0,0],[1,1]], [[0,0],[0,0]] ),
          "left"   : ( [[0,0],[0,0]], [[0,1],[0,1]], [[0,0],[1,1]] ),
          "right"  : ( [[1,1],[1,1]], [[0,1],[0,1]], [[0,0],[1,1]] ),
          "front"  : ( [[0,1],[0,1]], [[0,0],[0,0]], [[0,0],[1,1]] ),
          "back"   : ( [[0,1],[0,1]], [[1,1],[1,1]], [[0,0],[1,1]] )
      }
      return planes
  
  def render_array(ary, highlight):
      fig = plt.figure()
      ax = fig.add_subplot(111, projection='3d')
  
      cube = make_cube()
  
      for space in xrange(0, ary.shape[0]):
          for column in xrange(0, ary.shape[1]):
              for row in xrange(0, ary.shape[2]):
                  alpha = 0.01
                  if highlight[space,column,row] == 1:
                      alpha = 1
                  for side in cube:
                      (Xs, Ys, Zs) = (
                          np.asarray(cube[side][0])+space+space*0.2,
                          np.asarray(cube[side][2])+row+row*0.2,
                          np.asarray(cube[side][3])+column+column*0.2
                      )
                      ax.plot_surface(Xs, Ys, Zs, rstride=1, cstride=1, alpha=alpha)
  
      highest = 0                         # Make it look cubic
      for size in ary.shape:
          if size &gt; highest:
              highest = size
      ax.set_xlim((0,highest))
      ax.set_ylim((0,highest))
      ax.set_zlim((0,highest))
  
  
      ax.set_xlabel('Third dimension' )   # Meant to visualize ROW-MAJOR ordering 
      ax.set_ylabel('Row(s)')
      ax.set_zlabel('Column(s)')
  
      #plt.axis('off')    # This also removes the axis labels... i want those...
      #ax.set_axis_off()  # this removes too much (also the labels)
  
      # So I try this instead...
      ax.set_xticks([])          # removes the ticks... great now the rest of it
      ax.set_yticks([])
      ax.set_zticks([])
      #ax.grid(False)             # this does nothing....
      #ax.set_frame_on(False)     # this does nothing....
      plt.show()
  
  def main():
  
      subject = np.ones((3,4,3))
  
      highlight = np.zeros(subject.shape) # Highlight a row
      highlight[1,1,:] = 1
  
      render_array(subject, highlight)    # Show it
  
  if __name__ == "__main__":
      main()
  </code></pre>
  
  <p><strong>Update</strong>, thanks to the answer, here is what I was missing:</p>
  
  <pre><code># Get rid of the panes                          
  ax.w_xaxis.set_pane_color((1.0, 1.0, 1.0, 0.0)) 
  ax.w_yaxis.set_pane_color((1.0, 1.0, 1.0, 0.0)) 
  ax.w_zaxis.set_pane_color((1.0, 1.0, 1.0, 0.0)) 
  
  # Get rid of the spines                         
  ax.w_xaxis.line.set_color((1.0, 1.0, 1.0, 0.0)) 
  ax.w_yaxis.line.set_color((1.0, 1.0, 1.0, 0.0)) 
  ax.w_zaxis.line.set_color((1.0, 1.0, 1.0, 0.0))
  </code></pre>
  
  <p>Which will, together with:</p>
  
  <pre><code># Get rid of the ticks                          
  ax.set_xticks([])                               
  ax.set_yticks([])                               
  ax.set_zticks([])
  </code></pre>
  
  <p>Hide everything but the labels, as illustrated in 3).</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>I've cleaned and got the code into a working state and made it available here:
  <a href="https://github.com/safl/ndarray_plot" rel="noreferrer">https://github.com/safl/ndarray_plot</a></p>
  
  <p>Along with a couple of additional examples here:
  <a href="http://nbviewer.ipython.org/github/safl/ndarray_plot/blob/master/nb/ndap.ipynb" rel="noreferrer">http://nbviewer.ipython.org/github/safl/ndarray_plot/blob/master/nb/ndap.ipynb</a></p>