I’d like to get three charts, one under one, using multiplot.
I tried:
#! /usr/bin/env 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 output 'filename.svg'")
g("unset xtics")
g("unset ytics")
g("set size 200,200")
g("set bmargin 0")
g("set tmargin 0")
g("set lmargin 0")
g("set rmargin 0")
g("set multiplot")
#First
g("set origin 0.1,0.1")
d = gp.Data(x,y,with_="linespoints")
g.plot(d)
#Second
g("set origin 0.1,50")
d1 = gp.Data(x1,y,with_="linespoints")
g.plot(d1)
# Third
g("set origin 0.1,100")
d2 = gp.Data(y,x,with_="linespoints")
g.plot(d2)
g("unset multiplot")
starting from http://t16web.lanl.gov/Kawano/gnuplot/plot3-e.html
But I get an error when I wanna display the svg created.
Suggestions?
FB
The problem is that you aren’t setting the terminal. Gnuplot’s just sending the output to the x11 terminal (or whatever you’ve configured to be default). if your default terminal isn’t
svg, then you’ll get an error — either the file won’t exist, of the type of encoding won’t match thesvgextension.add
g("set terminal svg")right beforeg("set output 'filename.svg'")and you should be all set.