I'm hoping someone here is familiar with ngspice who can guide me through this. I have been trying for days for a way to export ngspice plots/graphs to some kind of image file, like png, so I can post it to a web page or send via email.
I can use the hardcopy command to create an eps file, but it is not anywhere near as nice looking as the plot displayed with the plot command.
Someone had suggested I try gnuplot, but I haven't been able to get that to work for me. The ngspice manual section on using gnuplot for output is very terse, just a few sentences at 17.5.25, page 285.
test2.net is the name of the netlist I am currently working on. Here it is:
Code:
ngspice 2 -> listing
bipolar transistor simulation
1 : bipolar transistor simulation
2 : .global gnd
3 : i1 0 1 dc 75u
4 : q1 2 1 0 mod1
5 : vammeter 3 2 dc 0
6 : v1 3 0 dc
7 : .model mod1 npn
9 : .end
When at the ngspice command prompt I do:
Code:
ngspice 2 -> gnuplot test2 v(1)
I am presented with a new window with a gnuplot prompt. I was expecting a plot window!?!
As the manual says, ngspice creates three files, test2.data, test2.plt, and test2.eps. If I open the eps file (using a different terminal) it is blank, whether I open it with gv, gimp or anything else. The eps file is not empty, it just shows nothing.
I am unfamiliar with gnuplot, and don't want to have to learn all it's syntax just to get an image. I tried:
Code:
gnuplot> load 'test2.plt'
and that appears to write to test2.eps again (by looking at the timestamp), but again the test2.eps file when opened in gv is blank.
I am wondering if there is a problem with the way I'm asking gnuplot to write the output. Or could there be some kind of configuration parameter I need to set?
I'm using Debian with i3 tiling wm. In case it is helpful here is a link to the test2.eps file:
www.strucktower.com/test2.eps
Any ideas?
Thanks,
Keith
Here is test2.plt:
Code:
keith@t520:~/gaf$ cat test2.plt
set title "bipolar transistor simulation "
set xlabel "V"
set ylabel "V"
set grid
unset logscale x
set xrange [0.000000e+00:5.000000e+01]
unset logscale y
set yrange [6.653309e-01:8.264312e-01]
#set xtics 1
#set x2tics 1
#set ytics 1
#set y2tics 1
plot 'test2.data' using 1:2 with lines lw 1 title "v(1)"
set terminal push
set terminal postscript eps color
set out 'test2.eps'
replot
set term pop
replot