comparison scripts/plot/pie.m @ 14001:5f0bb45e615c

doc: Update documentation for functions returning a graphics handle h (Bug #34761) * voronoi.m, image.m, imagesc.m, imshow.m, area.m, bar.m, barh.m, clabel.m, clf.m, compass.m, ezcontour.m, ezcontourf.m, ezmesh.m, ezmeshc.m, ezplot.m, ezplot3.m, ezpolar.m, ezsurf.m, ezsurfc.m, feather.m, fill.m, findall.m, findobj.m, loglog.m, mesh.m, pareto.m, patch.m, pie.m, pie3.m, plot.m, polar.m, quiver.m, quiver3.m, rectangle.m, ribbon.m, rose.m, scatter.m, scatter3.m, semilogx.m, semilogy.m, slice.m, stem.m, surf.m, surface.m, text.m, title.m, trimesh.m, triplot.m, trisurf.m, xlabel.m, ylabel.m, zlabel.m: Update documentation for functions returning a graphics handle h.
author Rik <octave@nomad.inbox5.com>
date Tue, 06 Dec 2011 13:09:17 -0800
parents c792872f8942
children 22c50cbad2ce
comparison
equal deleted inserted replaced
14000:15400d5deb1c 14001:5f0bb45e615c
20 ## @deftypefn {Function File} {} pie (@var{x}) 20 ## @deftypefn {Function File} {} pie (@var{x})
21 ## @deftypefnx {Function File} {} pie (@var{x}, @var{explode}) 21 ## @deftypefnx {Function File} {} pie (@var{x}, @var{explode})
22 ## @deftypefnx {Function File} {} pie (@dots{}, @var{labels}) 22 ## @deftypefnx {Function File} {} pie (@dots{}, @var{labels})
23 ## @deftypefnx {Function File} {} pie (@var{h}, @dots{}); 23 ## @deftypefnx {Function File} {} pie (@var{h}, @dots{});
24 ## @deftypefnx {Function File} {@var{h} =} pie (@dots{}); 24 ## @deftypefnx {Function File} {@var{h} =} pie (@dots{});
25 ## Produce a pie chart. 25 ## Produce a 2-D pie chart.
26 ## 26 ##
27 ## Called with a single vector argument, produces a pie chart of the 27 ## Called with a single vector argument, produces a pie chart of the
28 ## elements in @var{x}, with the size of the slice determined by percentage 28 ## elements in @var{x}, with the size of the slice determined by percentage
29 ## size of the values of @var{x}. 29 ## size of the values of @var{x}.
30 ## 30 ##
32 ## if non zero 'explodes' the slice from the pie chart. 32 ## if non zero 'explodes' the slice from the pie chart.
33 ## 33 ##
34 ## If given @var{labels} is a cell array of strings of the same length as 34 ## If given @var{labels} is a cell array of strings of the same length as
35 ## @var{x}, giving the labels of each of the slices of the pie chart. 35 ## @var{x}, giving the labels of each of the slices of the pie chart.
36 ## 36 ##
37 ## The optional return value @var{h} provides a handle to the patch object. 37 ## The optional return value @var{h} is a list of handles to the patch
38 ## and text objects generating the plot.
38 ## 39 ##
39 ## @seealso{pie3, bar, stem} 40 ## @seealso{pie3, bar, stem}
40 ## @end deftypefn 41 ## @end deftypefn
41 42
42 ## Very roughly based on pie.m from octave-forge whose author was 43 ## Very roughly based on pie.m from octave-forge whose author was
63 retval = tmp; 64 retval = tmp;
64 endif 65 endif
65 66
66 endfunction 67 endfunction
67 68
69
68 %!demo 70 %!demo
69 %! pie ([3, 2, 1], [0, 0, 1]); 71 %! pie ([3, 2, 1], [0, 0, 1]);
70 %! colormap([1,0,0;0,1,0;0,0,1;1,1,0;1,0,1;0,1,1]); 72 %! colormap ([1,0,0;0,1,0;0,0,1;1,1,0;1,0,1;0,1,1]);
71 73
72 %!demo 74 %!demo
73 %! pie ([3, 2, 1], [0, 0, 1], {"Cheddar", "Swiss", "Camembert"}); 75 %! pie ([3, 2, 1], [0, 0, 1], {"Cheddar", "Swiss", "Camembert"});
74 %! colormap([1,0,0;0,1,0;0,0,1;1,1,0;1,0,1;0,1,1]); 76 %! colormap ([1,0,0;0,1,0;0,0,1;1,1,0;1,0,1;0,1,1]);
75 %! axis ([-2,2,-2,2]); 77 %! axis ([-2,2,-2,2]);
76 78
77 %!demo 79 %!demo
78 %! pie ([0.17, 0.34, 0.41], {"Cheddar", "Swiss", "Camembert"}); 80 %! pie ([0.17, 0.34, 0.41], {"Cheddar", "Swiss", "Camembert"});
79 %! colormap([1,0,0;0,1,0;0,0,1;1,1,0;1,0,1;0,1,1]); 81 %! colormap ([1,0,0;0,1,0;0,0,1;1,1,0;1,0,1;0,1,1]);
80 %! axis ([-2,2,-2,2]); 82 %! axis ([-2,2,-2,2]);
81 %! title ("missing slice"); 83 %! title ("missing slice");
84