Mercurial > hg > octave-lyh
comparison scripts/plot/print.m @ 6870:e2e5425905ac
[project @ 2007-09-06 20:18:20 by jwe]
author | jwe |
---|---|
date | Thu, 06 Sep 2007 20:18:28 +0000 |
parents | db0a05a61d09 |
children | bdbe9778d995 |
comparison
equal
deleted
inserted
replaced
6869:f9c893831e68 | 6870:e2e5425905ac |
---|---|
117 fontsize = ""; | 117 fontsize = ""; |
118 font = ""; | 118 font = ""; |
119 name = ""; | 119 name = ""; |
120 devopt = ""; | 120 devopt = ""; |
121 printer = ""; | 121 printer = ""; |
122 debug = false; | |
123 debug_file = "octave-print-commands.log" | |
122 | 124 |
123 for i = 1:nargin | 125 for i = 1:nargin |
124 arg = varargin{i}; | 126 arg = varargin{i}; |
125 if (ischar (arg)) | 127 if (ischar (arg)) |
126 if (strcmp (arg, "-color")) | 128 if (strcmp (arg, "-color")) |
133 force_solid = -1; | 135 force_solid = -1; |
134 elseif (strcmp (arg, "-portrait")) | 136 elseif (strcmp (arg, "-portrait")) |
135 orientation = "portrait"; | 137 orientation = "portrait"; |
136 elseif (strcmp (arg, "-landscape")) | 138 elseif (strcmp (arg, "-landscape")) |
137 orientation = "landscape"; | 139 orientation = "landscape"; |
140 elseif (strncmp (arg, "-debug", 6)) | |
141 debug = true; | |
142 if (length (arg) > 7) | |
143 debug_file = arg(7:end); | |
144 endif | |
138 elseif (length (arg) > 2 && arg(1:2) == "-d") | 145 elseif (length (arg) > 2 && arg(1:2) == "-d") |
139 devopt = arg(3:length(arg)); | 146 devopt = arg(3:end); |
140 elseif (length (arg) > 2 && arg(1:2) == "-P") | 147 elseif (length (arg) > 2 && arg(1:2) == "-P") |
141 printer = arg; | 148 printer = arg; |
142 elseif (length (arg) > 2 && arg(1:2) == "-F") | 149 elseif (length (arg) > 2 && arg(1:2) == "-F") |
143 idx = rindex(arg, ":"); | 150 idx = rindex(arg, ":"); |
144 if (idx) | 151 if (idx) |
330 elseif (strcmp (dev, "dxf") || strcmp (dev, "mf") || strcmp (dev, "hpgl")) | 337 elseif (strcmp (dev, "dxf") || strcmp (dev, "mf") || strcmp (dev, "hpgl")) |
331 ## AutoCad DXF, METAFONT, HPGL | 338 ## AutoCad DXF, METAFONT, HPGL |
332 new_terminal = dev; | 339 new_terminal = dev; |
333 endif | 340 endif |
334 | 341 |
335 drawnow (new_terminal, name); | 342 if (debug) |
343 drawnow (new_terminal, name, debug_file); | |
344 else | |
345 drawnow (new_terminal, name); | |
346 endif | |
336 | 347 |
337 if (! isempty (convertname)) | 348 if (! isempty (convertname)) |
338 command = sprintf ("convert '%s' '%s'", name, convertname); | 349 command = sprintf ("convert '%s' '%s'", name, convertname); |
339 [errcode, output] = system (command); | 350 [errcode, output] = system (command); |
340 unlink (name); | 351 unlink (name); |