2D Map in matplotlib with discrete values
<p>I'm currently trying to plot with matplotlib a 2d map recorded with an instrument. The instrument is moving 2 motors (it makes a raster) and records the associated intensity value.
I'm currently able to plot the data and to associate the values I want to the axes, but I would like to digitize (make discrete) these values in order to obtain at each pixel of the image the corresponding values for the motors.</p>

<p>I'm currently using the following code (in the example I'll use x and y to define the motor positions):</p>

<pre><code>import pylab as pl
pl.imshow(intensity, extent=(x_min, x_max, y_min, y_max),
          interpolation='none')
</code></pre>

<p>The code works quite well but if I select one of the pixel on my plot with the cursor, it returns continuous values with many digits (like in figure).</p>

<p><a href="https://i.stack.imgur.com/SEH3W.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/SEH3W.png" alt="example_map"></a></p>

<p>Would it be possible to obtain directly the values of the motors (which I have stored for each point/pixel) by positioning the cursor on them?</p>

<p>Thanks for the help,</p>

<p>Fabio</p>