center似乎可以工作,但是如何获取center对应一个数据点-或更准确地说,是对应于该数据点上方的几个像素我们也将不胜感激地收到任何其他建议解决方案此处分两个步骤进行操作:IMG_LIST="cloud.png sun.png"X=""Y=""IMG=""storedata(x,y,index_img)= \ (X=X.sprintf(" %f",x), \ Y=Y.sprintf(" %f",y), \ IMG=IMG." ".word(IMG_LIST,int(index_img)),y)plot '-' using 1:(storedata($1,$2,$3))0.5 23 21.5 27 22.5 19 1eplot [0:3][0:40] for [i=1:words(IMG)] word(IMG,i) binary filetype=png center=(word(X,i),word(Y,i)) dx=0.005 dy=0.05 with rgbimage notitle第一步是使用绘图数据构建列表(在字符串X,Y和IMG中用空格分隔的元素).然后,for循环在所需位置绘制图像. dx和dy需要根据您的图像大小和绘图范围进行调整(可以使用GPVAL_*数据自动进行.) I know this was asked before a while ago using images for points but I was wondering whether someone can provide more detailed help, or whether any recent changes in gnuplot make this easier?My question is slightly different and I didn't want to reopen a 6yo questionI'm trying to produce a plot for a weather forecast similar to this:AIX weather widget screenshotI have some data from openweathermap's api, and an icon set - plotting the temp, rainfall, etc is trivial.. What I would like to do is plot an image/ icon to show the weather just above the temperature plotIt looks like center would work, but how can I get center to correspond to a datapoint - or more accurately to a few pixels above the datapointAny alternative suggestions would also be gratefully received 解决方案 Here's how to do it in two steps:IMG_LIST="cloud.png sun.png"X=""Y=""IMG=""storedata(x,y,index_img)= \ (X=X.sprintf(" %f",x), \ Y=Y.sprintf(" %f",y), \ IMG=IMG." ".word(IMG_LIST,int(index_img)),y)plot '-' using 1:(storedata($1,$2,$3))0.5 23 21.5 27 22.5 19 1eplot [0:3][0:40] for [i=1:words(IMG)] word(IMG,i) binary filetype=png center=(word(X,i),word(Y,i)) dx=0.005 dy=0.05 with rgbimage notitleFirst step is to build lists (space separated elements in strings X, Y, and IMG) with the plot data. Then a for-loop plots the images at the desired location. The dx and dy need to be adjusted depending on your image size and the plot ranges (could be automated with GPVAL_* data). 这篇关于Gnuplot-在点处绘制图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
09-05 20:58
查看更多