2019/10/20

今天在使用gnuplot
發現一個問題
當先進入gnuplot後再下指令畫圖
可以跳出另一個視窗
可是如果使用
gnuplot -e 的方式
畫面一閃就不見了
只能夠output到檔案

gnuplot -e "set terminal png; set output '/tmp/1.png'; plot '/tmp/33' with line"

另外如果在python 呼叫 gnuplot
也不能在視窗上顯示
只能夠output到檔案

語法如下

import Gnuplot

g = Gnuplot.Gnuplot()
g("set terminal png")
g("set output '/tmp/1.png'")
g.plot("'/tmp/33' with line")

記得要先 apt install  python-gnuplot

看圖指令
eog /tmp/1.png






















http://yurinfore.blogspot.com/2007/05/python.html

沒有留言: