Gert Gottschalk
Gert Gottschalk

Reputation: 1716

Adding a background image to Gnuplot

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

Upvotes: 0

Views: 4931

Answers (1)

Christoph
Christoph

Reputation: 48440

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

Upvotes: 1

Related Questions