Electrical – How to plot voltage vs current in HSPICE/MacSPICE

spice

I have a transient simulation for a simple voltage divider for MacSPICE shown below. I'm able to plot certain variables under test vs. time. How can I do a current vs. voltage plot for the transient data?

Voltage Divider - Sine

vin 1 0 sin (0.0V 1.0V 50) ac 1.0 dc 0.0
r1 1 2 1.0K
r2 2 0 1.0k

.control
* dispose of any 'save' statements from previous runs
delete all
tran 0.1ms 20ms
plot v(1) v(2)
plot -i(vin)
.endc

.end

Best Answer

The command:

plot -i(vin) vs v(1)

is what you need.