title: How should I plot XYZ data points to create a depth image in RGB in python
body: <p>I am working on a small project where I am given a 2D array of XYZ data. Something in this manner:</p>
  <pre><code>a = [[1,7,13,3,4],
       [6,21,32,11,2]]
  </code></pre>
  <p>where x represents the column of the array, y represents the row of the array, and z represents the content of the array, which is the distance. What I am trying to accomplish is to use the 2d array and plot a depth image in RGB. To elaborate, the closer the distance (z) value, I want the point to be plotted as red. And as the distance (z) values increase, I want to plot it yellow, green or blue depending on how large the distance is.</p>
  <p>I added a sample picture for better clarification.<br />
  <a href="https://i.stack.imgur.com/c0Ct9.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/c0Ct9.png" alt="Depth image" /></a></p>
  <p>I am trying to accomplish this in python. I tried researching into it, but most of the time I found how to extract XYZ data from a depth image or from a point cloud, instead of using XYZ data to plot a depth image.</p>
  <p>Please let me know if this is possible or what python libraries are available to achieve this.</p>
  <p>Thank you.</p>
  <p>EDIT: I believe it might help noting that the 2D array consists of point cloud data generated by a rangefinder sensor. I want to be able to construct a still 2d image of the scanned area using the data points. I also want to make use of colormaps in order to allow me to visualize the depth of the image.</p>