Adding a background image to Gnuplot

允我心安 提交于 2019-12-13 04:32:45

问题


I want to put a jpg image as background for a gnuplot output file. The goal is to have a nice looking web based weather station.

Right now I'm using gnuplot png output with transparent background setting and then setting a background image in the html code. But the result looks funky around the text. Check out the current state at :

http://drgert.dyndns.ws:8000/bmp085/bmp085.php

So I was thinking it might be better to set the background in gnuplot itself. I can set a background using a rectangle object to cover the plot area. But is it possible to use a jpg in that rectangle?

Thanks, Gert


回答1:


Basically you could add a background image to the plot like shown in Gnuplot image on axis, but with filetype=jpg. But that wouldn't look like you showed in your link, but would be only inside the graph.

You actual problem is, that the png terminal, which uses libgd, seems to have problems to render the transparency when anti-aliasing the fonts. You can use the pngcairo terminal, which doesn't have this problem, see the following example:

set terminal pngcairo transparent
set output 'transparent.png'
plot sin(x)
set output


来源:https://stackoverflow.com/questions/18583748/adding-a-background-image-to-gnuplot

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