# How to plot voltage vs current in HSPICE/MacSPICE?

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

• To clarify, this isn't actually about HSPICE, just SPICE in general, right? – W5VO Sep 19 '16 at 16:44
• Correct. I just didn't want any GUI-based solutions, like for LTSPICE and PSPICE. – herrtim Sep 19 '16 at 16:49

plot -i(vin) vs v(1)