summaryrefslogtreecommitdiff
path: root/Windows/spice/share/ngspice/scripts/devaxis
blob: 7b3d23f32e7936dd794dc5240e7a0be1af89b0a7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
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