how can output data from a rawfile or svg?

183 Views Asked by At

there! I'm using Ngspice to do circuit simulations. and plot a vector,but i don't know how to export data from an svg or raw file.The circuit is like below.enter image description here

and the netlist is below

ivdd 0 nd_pkg_pad 0 ac 1.0
.ac dec 100 10meg 10g
.save vm(nd_pkg_pad)
.control
set filetype=ascii
run
plot vm(nd_pkg_pad) xlog ylog
.endc
.end

Then run the netlist on Linux 20.04 The command is

ngspice
ngspice-> source circuit1.sp

Then it outputs a plot as below:

enter image description here

it can be saved in SVG format. but I wanna know how to extract data from this plot and export it to excel like choosing 1000 points of frequency and their corresponding voltage value.

it's better to use python code because a lot of plots to be handled.Thanks a lot!!!

1

There are 1 best solutions below

1
On

The method to transform voltage plot to data is using "wrdata" for example,in a .cir or .sp file ,a circuit netlist file,the command is:

wrdata filename(like test.txt) vm(node1)

<----(vm represent voltage,and node1 is a node name)

then test.txt will be generated and you can see the voltage data when do ac analysis.