Mercurial > hg > octave-lyh
annotate scripts/plot/pie3.m @ 16581:fa4a035e0cf4
Add octave_link uiputfile implementation
* libgui/src/dialog.cc, libgui/src/dialog.h
(FileDialog::FileDialog): Change bool multiselect to QString multimode, add mode option of 'create' and set options accordingly.
(QUIWidgetCreator::signal_filedialog): Change bool multiselect to QString multimode.
(QUIWidgetCreator::create_filedialog): Change bool multiselect to QString multimode.
* libgui/src/main-window.cc, libgui/src/main-window.h
(main_window::connect_uiwidget_links): update bool multiselect to QString multimode.
(main_window::handle_create_filedialog): update bool multiselect to QString multimode.
* libgui/src/octave-qt-link.h
(octave_qt_link::do_file_dialog): update bool multiselect to std::string multimode.
* libinterp/interpfcn/octave-link.h
(octave_link::do_file_dialog): update bool multiselect to std::string multimode.
(octave_link::file_dialog): update bool multiselect to std::string multimode.
* scripts/plot/uiputfile.m
(uiputfile): update to call __octave_link_file_dialog__ if octave_link is present.
author | John Donoghue <john.donoghue@ieee.org> |
---|---|
date | Sun, 28 Apr 2013 17:00:00 -0400 |
parents | 7277fe922e99 |
children | 64e7bb01fce2 |
rev | line source |
---|---|
14138
72c96de7a403
maint: update copyright notices for 2012
John W. Eaton <jwe@octave.org>
parents:
14092
diff
changeset
|
1 ## Copyright (C) 2007-2012 David Bateman |
11330 | 2 ## Copyright (C) 2010 Kai Habel |
3 ## | |
4 ## This file is part of Octave. | |
5 ## | |
6 ## Octave is free software; you can redistribute it and/or modify it | |
7 ## under the terms of the GNU General Public License as published by | |
8 ## the Free Software Foundation; either version 3 of the License, or (at | |
9 ## your option) any later version. | |
10 ## | |
11 ## Octave is distributed in the hope that it will be useful, but | |
12 ## WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
14 ## General Public License for more details. | |
15 ## | |
16 ## You should have received a copy of the GNU General Public License | |
17 ## along with Octave; see the file COPYING. If not, see | |
18 ## <http://www.gnu.org/licenses/>. | |
19 | |
20 ## -*- texinfo -*- | |
11341
3c7ba1e3dc21
Add missing option slice for pie and pie3
Kai Habel <kai.habel@gmx.de>
parents:
11330
diff
changeset
|
21 ## @deftypefn {Function File} {} pie3 (@var{x}) |
3c7ba1e3dc21
Add missing option slice for pie and pie3
Kai Habel <kai.habel@gmx.de>
parents:
11330
diff
changeset
|
22 ## @deftypefnx {Function File} {} pie3 (@var{x}, @var{explode}) |
11330 | 23 ## @deftypefnx {Function File} {} pie3 (@dots{}, @var{labels}) |
24 ## @deftypefnx {Function File} {} pie3 (@var{h}, @dots{}); | |
25 ## @deftypefnx {Function File} {@var{h} =} pie3 (@dots{}); | |
12344
68ac95d2460c
Periodic grammarcheck of documentation.
Rik <octave@nomad.inbox5.com>
parents:
11587
diff
changeset
|
26 ## Draw a 3-D pie chart. |
11330 | 27 ## |
11563
3c6e8aaa9555
Grammarcheck m-files before 3.4 release.
Rik <octave@nomad.inbox5.com>
parents:
11523
diff
changeset
|
28 ## Called with a single vector argument, produces a 3-D pie chart of the |
11330 | 29 ## elements in @var{x}, with the size of the slice determined by percentage |
30 ## size of the values of @var{x}. | |
31 ## | |
32 ## The variable @var{explode} is a vector of the same length as @var{x} that | |
14359
7277fe922e99
doc: Use Octave preference for double quote in docstrings in scripts/
Rik <octave@nomad.inbox5.com>
parents:
14245
diff
changeset
|
33 ## if non zero "explodes" the slice from the pie chart. |
11330 | 34 ## |
35 ## If given @var{labels} is a cell array of strings of the same length as | |
11587
c792872f8942
all script files: untabify and strip trailing whitespace
John W. Eaton <jwe@octave.org>
parents:
11563
diff
changeset
|
36 ## @var{x}, giving the labels of each of the slices of the pie chart. |
11330 | 37 ## |
14001
5f0bb45e615c
doc: Update documentation for functions returning a graphics handle h (Bug #34761)
Rik <octave@nomad.inbox5.com>
parents:
12344
diff
changeset
|
38 ## The optional return value @var{h} is a list of graphics handles to the patch, |
5f0bb45e615c
doc: Update documentation for functions returning a graphics handle h (Bug #34761)
Rik <octave@nomad.inbox5.com>
parents:
12344
diff
changeset
|
39 ## surface, and text objects generating the plot. |
11330 | 40 ## |
41 ## @seealso{pie, bar, stem} | |
42 ## @end deftypefn | |
43 | |
44 ## Very roughly based on pie.m from octave-forge whose author was | |
45 ## Daniel Heiserer <Daniel.heiserer@physik.tu-muenchen.de> | |
46 | |
47 function retval = pie3 (varargin) | |
48 | |
49 [h, varargin] = __plt_get_axis_arg__ ("pie", varargin{:}); | |
50 | |
51 if (nargin < 1) | |
52 print_usage (); | |
53 else | |
54 oldh = gca (); | |
55 unwind_protect | |
56 axes (h); | |
57 newplot (); | |
58 tmp = __pie__ ("pie3", h, varargin{:}); | |
59 unwind_protect_cleanup | |
60 axes (oldh); | |
61 end_unwind_protect | |
62 endif | |
63 | |
64 if (nargout > 0) | |
65 retval = tmp; | |
66 endif | |
67 | |
68 endfunction | |
69 | |
14001
5f0bb45e615c
doc: Update documentation for functions returning a graphics handle h (Bug #34761)
Rik <octave@nomad.inbox5.com>
parents:
12344
diff
changeset
|
70 |
11330 | 71 %!demo |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
72 %! clf; |
11330 | 73 %! pie3 ([5:-1:1], [0, 0, 1, 0, 0]); |
14001
5f0bb45e615c
doc: Update documentation for functions returning a graphics handle h (Bug #34761)
Rik <octave@nomad.inbox5.com>
parents:
12344
diff
changeset
|
74 %! colormap ([1,0,0;0,1,0;0,0,1;1,1,0;1,0,1;0,1,1]); |
11330 | 75 |
76 %!demo | |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
77 %! clf; |
14245
4506eade9f04
Use Matlab coding conventions for demos in plot/ directory.
Rik <octave@nomad.inbox5.com>
parents:
14237
diff
changeset
|
78 %! pie3 ([3, 2, 1], [0, 0, 1], {'Cheddar', 'Swiss', 'Camembert'}); |
14001
5f0bb45e615c
doc: Update documentation for functions returning a graphics handle h (Bug #34761)
Rik <octave@nomad.inbox5.com>
parents:
12344
diff
changeset
|
79 %! colormap ([1,0,0;0,1,0;0,0,1;1,1,0;1,0,1;0,1,1]); |
11330 | 80 %! axis ([-2,2,-2,2]); |
11341
3c7ba1e3dc21
Add missing option slice for pie and pie3
Kai Habel <kai.habel@gmx.de>
parents:
11330
diff
changeset
|
81 |
3c7ba1e3dc21
Add missing option slice for pie and pie3
Kai Habel <kai.habel@gmx.de>
parents:
11330
diff
changeset
|
82 %!demo |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
83 %! clf; |
14245
4506eade9f04
Use Matlab coding conventions for demos in plot/ directory.
Rik <octave@nomad.inbox5.com>
parents:
14237
diff
changeset
|
84 %! pie3 ([0.17, 0.34, 0.41], {'Cheddar', 'Swiss', 'Camembert'}); |
14001
5f0bb45e615c
doc: Update documentation for functions returning a graphics handle h (Bug #34761)
Rik <octave@nomad.inbox5.com>
parents:
12344
diff
changeset
|
85 %! colormap ([1,0,0;0,1,0;0,0,1;1,1,0;1,0,1;0,1,1]); |
11341
3c7ba1e3dc21
Add missing option slice for pie and pie3
Kai Habel <kai.habel@gmx.de>
parents:
11330
diff
changeset
|
86 %! axis ([-2,2,-2,2]); |
14245
4506eade9f04
Use Matlab coding conventions for demos in plot/ directory.
Rik <octave@nomad.inbox5.com>
parents:
14237
diff
changeset
|
87 %! title ('missing slice'); |
14001
5f0bb45e615c
doc: Update documentation for functions returning a graphics handle h (Bug #34761)
Rik <octave@nomad.inbox5.com>
parents:
12344
diff
changeset
|
88 |