summaryrefslogtreecommitdiff
path: root/Windows/spice/share/ngspice/scripts/devaxis
diff options
context:
space:
mode:
Diffstat (limited to 'Windows/spice/share/ngspice/scripts/devaxis')
-rw-r--r--Windows/spice/share/ngspice/scripts/devaxis69
1 files changed, 69 insertions, 0 deletions
diff --git a/Windows/spice/share/ngspice/scripts/devaxis b/Windows/spice/share/ngspice/scripts/devaxis
new file mode 100644
index 00000000..7b3d23f3
--- /dev/null
+++ b/Windows/spice/share/ngspice/scripts/devaxis
@@ -0,0 +1,69 @@
+* initialize a device plot
+.control
+begin
+ unset axis
+ if $argc = 1
+ set axis = $argv[1]
+ strcmp flag $axis "x"
+ if ($flag = 0)
+ echo "setting axis to x"
+ strcmp flag "$?&devaxis" "0"
+ if ($flag = 0)
+ strcmp flag "$?&xaxis" "0"
+ if ($flag = 0)
+ echo "Error: no x axis present"
+ else
+ transpose all
+ setscale xaxis
+ let devaxis = 1
+ end
+ else
+ strcmp flag "$&devaxis" "-1"
+ if ($flag = 0)
+ strcmp flag "$?&xaxis" "0"
+ if ($flag = 0)
+ echo "Error: no x axis present"
+ else
+ transpose all
+ setscale xaxis
+ let devaxis = 1
+ end
+ end
+ end
+ else
+ strcmp flag $axis "y"
+ if ($flag = 0)
+ echo "setting axis to y"
+ strcmp flag "$?&devaxis" "0"
+ if ($flag = 0)
+ strcmp flag "$?&yaxis" "0"
+ if ($flag = 0)
+ echo "Error: no y axis present"
+ else
+ setscale yaxis
+ let devaxis = -1
+ end
+ else
+ strcmp flag "$&devaxis" "1"
+ if ($flag = 0)
+ strcmp flag "$?&yaxis" "0"
+ if ($flag = 0)
+ echo "Error: no y axis present"
+ else
+ transpose all
+ setscale yaxis
+ let devaxis = -1
+ end
+ end
+ end
+ else
+ echo "Error: unknown axis" $axis
+ echo "usage: devaxis <x|y>"
+ end
+ end
+ else
+ echo "usage: devaxis <x|y>"
+ end
+
+ unset axis flag
+end