Mercurial > hg > octave-nkf
annotate scripts/plot/meshc.m @ 15137:16a6b0a6855d gui
GUI: support for octave arguments and integrate with run-octave.
* src/octave.h (octave_initialize_interpreter, octave_execute_interpreter):
New functions.
(octave_cmdline_argc, octave_cmdline_argv, octave_embedded): New variables.
* src/octave.cc (octave_cmdline_argc, octave_cmdline_argv, octave_embedded):
New variables.
(octave_initialize_interpreter, octave_execute_interpreter): New functions.
(octave_main): Rewrite using them.
* run-octave.in (octave_executable): New variable.
(-gui): New option flag.
* gui/src/octave-adapter/octave-main-thread.cc (octave_main_thread::run):
Use octave_execute_interpreter.
* gui/src/octave-gui.cc (dissociate_terminal): New function.
(main): Use it. Also use octave_initialize_interpreter.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Sun, 05 Aug 2012 16:15:58 -0400 |
parents | 72c96de7a403 |
children | c9346014fed2 |
rev | line source |
---|---|
14138
72c96de7a403
maint: update copyright notices for 2012
John W. Eaton <jwe@octave.org>
parents:
12133
diff
changeset
|
1 ## Copyright (C) 1996-2012 John W. Eaton |
6788 | 2 ## |
3 ## This file is part of Octave. | |
4 ## | |
5 ## Octave is free software; you can redistribute it and/or modify it | |
6 ## under the terms of the GNU General Public License as published by | |
7016 | 7 ## the Free Software Foundation; either version 3 of the License, or (at |
8 ## your option) any later version. | |
6788 | 9 ## |
10 ## Octave is distributed in the hope that it will be useful, but | |
11 ## WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
13 ## General Public License for more details. | |
14 ## | |
15 ## You should have received a copy of the GNU General Public License | |
7016 | 16 ## along with Octave; see the file COPYING. If not, see |
17 ## <http://www.gnu.org/licenses/>. | |
6788 | 18 |
19 ## -*- texinfo -*- | |
20 ## @deftypefn {Function File} {} meshc (@var{x}, @var{y}, @var{z}) | |
11587
c792872f8942
all script files: untabify and strip trailing whitespace
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
21 ## Plot a mesh and contour given matrices @var{x}, and @var{y} from |
c792872f8942
all script files: untabify and strip trailing whitespace
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
22 ## @code{meshgrid} and a matrix @var{z} corresponding to the @var{x} and |
c792872f8942
all script files: untabify and strip trailing whitespace
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
23 ## @var{y} coordinates of the mesh. If @var{x} and @var{y} are vectors, |
c792872f8942
all script files: untabify and strip trailing whitespace
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
24 ## then a typical vertex is (@var{x}(j), @var{y}(i), @var{z}(i,j)). Thus, |
c792872f8942
all script files: untabify and strip trailing whitespace
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
25 ## columns of @var{z} correspond to different @var{x} values and rows of |
6788 | 26 ## @var{z} correspond to different @var{y} values. |
27 ## @seealso{meshgrid, mesh, contour} | |
28 ## @end deftypefn | |
29 | |
30 function h = meshc (varargin) | |
31 | |
32 newplot (); | |
33 | |
7119 | 34 tmp = surface (varargin{:}); |
35 | |
36 ax = get (tmp, "parent"); | |
6788 | 37 |
7149 | 38 set (tmp, "facecolor", "w"); |
7119 | 39 set (tmp, "edgecolor", "flat"); |
12133
adbc08052ccd
meshc.m: Add note describing why the gnuplot backend is not consistent with Matlab.
Ben Abbott <bpabbott@mac.com>
parents:
11589
diff
changeset
|
40 ## FIXME - gnuplot does not support a filled surface and a |
adbc08052ccd
meshc.m: Add note describing why the gnuplot backend is not consistent with Matlab.
Ben Abbott <bpabbott@mac.com>
parents:
11589
diff
changeset
|
41 ## non-filled contour. 3D filled patches are also not supported. |
adbc08052ccd
meshc.m: Add note describing why the gnuplot backend is not consistent with Matlab.
Ben Abbott <bpabbott@mac.com>
parents:
11589
diff
changeset
|
42 ## Thus, the facecolor will be transparent for the gnuplot |
adbc08052ccd
meshc.m: Add note describing why the gnuplot backend is not consistent with Matlab.
Ben Abbott <bpabbott@mac.com>
parents:
11589
diff
changeset
|
43 ## backend. |
6788 | 44 |
7146 | 45 if (! ishold ()) |
11427
dc983f92e774
contour3.m: Grid on be default for 3D plots.
Ben Abbott <bpabbott@mac.com>
parents:
11426
diff
changeset
|
46 set (ax, "view", [-37.5, 30], |
dc983f92e774
contour3.m: Grid on be default for 3D plots.
Ben Abbott <bpabbott@mac.com>
parents:
11426
diff
changeset
|
47 "xgrid", "on", "ygrid", "on", "zgrid", "on"); |
7146 | 48 endif |
6788 | 49 |
11589
b0084095098e
missing semicolons in script files
John W. Eaton <jwe@octave.org>
parents:
11587
diff
changeset
|
50 drawnow (); |
11426
c503ccbe5033
Place contour for meshc/surfc at zlim(1)
Ben Abbott <bpabbott@mac.com>
parents:
7207
diff
changeset
|
51 zmin = get (ax, "zlim")(1); |
6788 | 52 |
7170 | 53 [c, tmp2] = __contour__ (ax, zmin, varargin{:}); |
6788 | 54 |
7170 | 55 tmp = [tmp; tmp2]; |
6788 | 56 |
57 if (nargout > 0) | |
58 h = tmp; | |
59 endif | |
7119 | 60 |
6788 | 61 endfunction |