Python Matplotlib point colour

天涯浪子 提交于 2019-12-05 09:49:40

This is what the scatter plot is for:

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)
scatter(x, y, marker='h', c=t, s=150)

colorbar()
show()

Note that the arguments are different from plot and that the size scale differently. If you want to change the color of the points, you might wanna use the cmap argument of scatter

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!