I have:
- An image of an insole with 16 pressure sensors.
- A 2*8 numpy array of pressure values for each sensor
- Pressure values update in real time every 0.1[s]
I want to:
- Display the image in the background of plot
- Overlay to each pressure sensor(black dot) the Heatmap value of pressure applied
- update pressure values every 0.1[s]
The code below does overlay the updating heatmap with background image, however I don't know how to reposition the heatmap to overlay with the sensors (black dots)
import matplotlib.pyplot as plt
import numpy as np
import time
#Trial combining heatmap + backgoround image
fig = plt.figure()
ax = fig.add_subplot(111)
im = ax.imshow(np.random.random((300,400))) # Usually 2*8 but cannot see it
img = plt.imread(r"..\Desktop\Example_image.PNG")
ax.imshow(img, alpha=0.5)
plt.show(block=False)
# draw some data in loop
for i in range(100):
# wait for a second
time.sleep(0.1)
# PRESSURE SENSOR VALUES USUALLY 2*8, USING 300*400 SO THEY ARE VISIBLE
Pressue_values = np.random.random((300,400))
im.set_array(Pressue_values)
# redraw the figure
fig.canvas.draw()
fig.canvas.flush_events()
How to map the 2*8 pressure values to the correct pressure sensor pixel?
Current result example - pixels are too small, need to map to correct position and expand to adjacent 
