我想用multiplot
得到三个图表,一个在一个下。在
我试过了:
#! /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")
从http://t16web.lanl.gov/Kawano/gnuplot/plot3-e.html开始
但是当我想显示所创建的svg时会出现一个错误。 建议? 食品饮料
问题是你没有设置终端。Gnuplot只是将输出发送到x11终端(或者您配置为默认值的任何东西)。如果您的默认终端不是
svg
,那么您将得到一个错误,要么文件不存在,要么编码类型与svg
扩展名不匹配。在在
g("set output 'filename.svg'")
之前加上g("set terminal svg")
,你应该都准备好了。在相关问题 更多 >
编程相关推荐