Can someone help me with ngspice syntax to use gnuplot for output? Output blank!
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 When at the ngspice command prompt I do: Code:
ngspice 2 -> gnuplot test2 v(1) 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' 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 |
Hi,
The command 'hardcopy' can help. For example add these lines to /usr/share/ngspice/scripts/spinit : Code:
** set hardcopy format Code:
hardcopy test.ps v(1) |
The .plt file looks reasonably decent. I am just not fond of .eps. It integrates nicely with Latex, but that is the only use I found for it.
First of all, check if your test2.dta contains sensible data. It should contain 2 columns. Column 1 the X-axis values, column 2 the Y-axis values. If the test2.dta is correct, modify the last lines of the test2.plt to this: Code:
set title "bipolar transistor simulation " gnuplot < test2.plt (make sure the data file is in the current directory) This should produce output. If you see error messages, post them. Next, in the ngspice file control section you can specify gnuplot_terminal png. After running ngspice check the test2.plt file again and see that set term eps is replaced by set term png. Run the .plt file again with gnuplot < test2.plt and see what happens. It is a nuisance that gnuplot is opened, the plot is created on screen and then once more put into a file. Unless you want to alter each .plt file you have to live with that. jlinkels |
All times are GMT -5. The time now is 05:59 PM. |