I have been looking at temperature plotting with sensors and wanted to find how I can either construct a contour/heat map or edit the colours of my points based on a cmap?
I have the following very basic plot:
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
import numpy as np
from pylab import *
figure(figsize=(15, 8))
# use ginput to select markers for the sensors
matplotlib.pyplot.hot()
markers = [(269, 792, 0.65), (1661, 800, 0.5), (1017, 457, 0.8)]
x,y,t = zip(*markers)
img = mpimg.imread('floor.png')
imgplot = plt.imshow(img, cmap=cm.hot)
plot(x, y, 'h', c=t, ms=15)
colorbar()
show()
The 3rd value in markers should hopefully be a point colour. However when I am making the plot it's colouring each point in the same way using the first value in markers. Is it possible to set the cmap of the points so I can use hot and relate it to an actual temperature? The current points are plotting in a light purple/lilac colour which I presume is the default cmap. I see cmap doesn't seem to be a valid value for plot so I'm not sure where I would specify that.
The alternative solution I would really like to try and figure out would be to instead use contours or histogram2d to show the heat radius. Is that possible to plot over an image? I had a look at This example but I can't seem to be able to edit it correctly to use actual values instead of the random function. Does anyone have an alternative solution/example code they have used in the past that does what I am looking for? I'm getting a little confused with what documentation I have found.
Thanks!