我正在尝试使用matplotlib
. 我imshow
用来绘制轮廓。如何以屏幕分辨率的大小绘制轮廓。
例如,(x,y)是坐标,z是位置的对应值:
import pylab as plt
import numpy as np
from Tkinter import *
root = Tk()
root.title("test window")
root.minsize(800, 600)
#(x,y) are pixel coordinates of canvas created on root, z= values
x=(563.603522282, 405.223798299,91.082456699,418.716359588,86.4813516941,244.703807775,480.84654939,418.702483547,241.136696875,319.613136686,257.545407017,117.714659717,174.788434125,425.913041522)
y=(96.3119943139,65.6348405695,353.988303883,354.795931878,170.857459385,156.952879623,161.233412703,241.960699493,214.026654031,65.6348405695,63.4945740292,54.2200856878,7.13422180103,3.56711090052)
z=(-1, 0, 0.5, -0.2, 1, 6, 0, -5, 4, 1.5, 2,7,-3,1)
Z=np.array((x,y,z)) #not sure from here
im = plt.imshow(Z, cmap='jet')
root.crate_image(im) # the image created by imshow paste on canvas
mainloop()
以上是我的代码的基本思想。但我不知道该怎么做。请帮忙