I'd like to get a transparent background in my gnuplot figure. What I coded till now is:
#! /usr/bin/python
from numpy import *
import Gnuplot as gp
import Gnuplot.funcutils
x = (1,2,3)
y=(2,4,5)
x1 = (3,6,8)
g = gp.Gnuplot()
g("set terminal svg size 200,400")
g("set output 'filename.svg'")
g("unset xtics")
g("unset ytics")
g("set multiplot layout 3,1 title 'Title here'")
g("set object 1 rectangle from screen 0,0 to screen 1,1 fillcolor rgb '#ff0000' behind")
#First
g("set tmargin 2")
g("set title 'Plot'")
g("unset key")
d = gp.Data(x,y,with_="lines")
g.plot(d)
#Secon
g("set title 'Plot2'")
g("unset key")
d1 = gp.Data(x1,y,with_="lines")
g.plot(d1)
#Third
g("set title 'Plot3'")
g("unset key")
d2 = gp.Data(y,x,with_="lines")
g.plot(d2)
g("unset multiplot")
I got a red screen but just the third plot. (Yeah, I have to change the rgb combo to get transparent background color. But, what's it?)
Thanks in advance, FB
set objectcode). Of course, you can make the background transparent byset object 1 rectangle ... fillstyle transparent solid 0(0-1 is the level of transparency, 0 being completely transparent) - mgilsondisplay--displayis a wrapper around imagemagick routines which are created (primarily) for raster images.displayusesgs(ghostscript) to handle vector graphics (I think) and I've heard that ghostscript doesn't handle transparency correctly on file formats other than postscript (e.g.pdf, maybesvgalso ... ). So, I wouldn't trust that what you're seeing indisplayis what is actually in the file. - mgilson