Examples for comparing of plotting with ngspice, gnuplot and pyplot

This commit is contained in:
Holger Vogt 2026-07-18 17:04:55 +02:00
parent 6d2335d1f7
commit 7900238bfc
2 changed files with 53 additions and 0 deletions

View File

@ -0,0 +1,19 @@
.title combplot pointplot boxesplot
.control
let vec1 = 2 * vector(10)
let vec2 = vector(10)
set xbrushwidth=3
set pointchars='o'
set curplottitle="combplot pointplot boxesplot"
plot vec1 vs vec2 combplot
gnuplot gpout vec1 vs vec2 combplot
pyplot pyout vec1 vs vec2 combplot
plot vec1 vs vec2 boxesplot ; this is not (yet) working
gnuplot gpout vec1 vs vec2 boxesplot
pyplot pyout vec1 vs vec2 boxesplot
plot vec1 vs vec2 pointplot
gnuplot gpout vec1 vs vec2 pointplot
pyplot pyout vec1 vs vec2 pointplot
.endc
.end

View File

@ -0,0 +1,34 @@
.title Inverter chain with pyplot
.tran 10n 1000n
XU30 out1 Vin Vcc 0 inv
XU32 out2 out1 Vcc 0 inv
XU33 out3 out2 Vcc 0 inv
.subckt inv out in vcc gnd
M1 out in gnd gnd N1
M2 out in vcc vcc N2
C1 out gnd 0.1p
.model N1 NMOS level=8 version=3.3.0
.model n2 PMOS level=8 version=3.3.0
.ends
VDC1 Vcc 0 DC 5
Vin1 Vin 0 pulse 0 5 0 10n 10n 240n 500n
.option noinit
.control
run
pyplot py1 Vin out1+6 out2+12 out3+18 title 'no. 1'
set pyplot_subplots=1
pyplot py2 Vin out1 out2 out3 title 'no. 2'
unset pyplot_subplots
pyplot Vin out1+6 out2+12 out3+18 title 'no. 3'
set pyplot_subplots=2
pyplot Vin out1 out2 out3 title 'no. 4'
quit
.endc
.end