title: Plot a surface with lists of latitude, longitude and elevation data (hillshading)
body: <p>I found this script on the matplotlib website:</p>
  
  <pre><code>"""
  Demonstrates using custom hillshading in a 3D surface plot.
  """
  from mpl_toolkits.mplot3d import Axes3D
  from matplotlib import cbook
  from matplotlib import cm
  from matplotlib.colors import LightSource
  import matplotlib.pyplot as plt
  import numpy as np
  
  filename = cbook.get_sample_data('jacksboro_fault_dem.npz', asfileobj=False)
  with np.load(filename) as dem:
      z = dem['elevation']
      nrows, ncols = z.shape
      x = np.linspace(dem['xmin'], dem['xmax'], ncols)
      y = np.linspace(dem['ymin'], dem['ymax'], nrows)
      x, y = np.meshgrid(x, y)
  
  region = np.s_[5:50, 5:50]
  x, y, z = x[region], y[region], z[region]
  
  fig, ax = plt.subplots(subplot_kw=dict(projection='3d'))
  
  ls = LightSource(270, 45)
  # To use a custom hillshading mode, override the built-in shading and pass
  # in the rgb colors of the shaded surface calculated from "shade".
  rgb = ls.shade(z, cmap=cm.gist_earth, vert_exag=0.1, blend_mode='soft')
  surf = ax.plot_surface(x, y, z, rstride=1, cstride=1, facecolors=rgb,
                         linewidth=0, antialiased=False, shade=False)
  
  plt.show()
  </code></pre>
  
  <p>They use the file <code>jacksboro_fault_dem.npz</code> to plot the elevation data and they get something like that:</p>
  
  <p><img src="https://i.stack.imgur.com/9v2uw.png" alt="3D Plot"></p>
  
  <p>Thanks to Google Earth I was able to get the text file <code>maido_elevation_data.txt</code> with latitude, longitude and elevation data of the following area (Maïdo, Reunion Island):</p>
  
  <p><img src="https://i.stack.imgur.com/PC8TF.jpg" alt="Maïdo, Reunion Island"></p>
  
  <p>I made a function to get 3 lists for each coordinate from the text file:</p>
  
  <pre><code>from mpl_toolkits.mplot3d import Axes3D
  import matplotlib.pyplot as plt
  
  def get_LAT_LONG_ALT(text_file):
      ch=""
      LAT=[]
      LONG=[]
      ALT=[]
      with open(text_file,"r") as fich:
          for ligne in fich:
              for e in ligne:
                  ch+=e
              liste=ch.replace("\n","").split("\t")
              LAT.append(float(liste[0]))
              LONG.append(float(liste[1]))
              ALT.append(float(liste[2]))
              ch=""
      return LAT,LONG,ALT
  
  fig = plt.figure()
  axes = fig.add_subplot(111, projection="3d")
  
  X = get_LAT_LONG_ALT("maido_elevation_data.txt")[0]
  Y = get_LAT_LONG_ALT("maido_elevation_data.txt")[1]
  Z = get_LAT_LONG_ALT("maido_elevation_data.txt")[2]
  
  axes.scatter(X,Y,Z, c="r", marker="o")
  
  axes.set_xlabel("Latitude")
  axes.set_ylabel("Longitude")
  axes.set_zlabel("Altitude")
  
  plt.show()
  </code></pre>
  
  <p>How should I modify the script to get a good surface plot with my own data like they do?</p>
  
  <p>PS: I will give you the links of the files in the comments because I'm not allowed to put more than 2 links... yes, I'm new :)</p>