Mercurial > hg > octave-nkf
comparison scripts/plot/contour3.m @ 17449:9e1ef7d2d21c
contour3.m: Turn off axis box for compatibility with Matlab.
* scripts/plot/contour3.m: Turn off axis "box" property.
Use cool colormap in %!demo code to see things more clearly.
author | Rik <rik@octave.org> |
---|---|
date | Thu, 19 Sep 2013 15:21:11 -0700 |
parents | 68bcac3c043a |
children |
comparison
equal
deleted
inserted
replaced
17448:93d2239b7fe9 | 17449:9e1ef7d2d21c |
---|---|
50 ## Example: | 50 ## Example: |
51 ## | 51 ## |
52 ## @example | 52 ## @example |
53 ## @group | 53 ## @group |
54 ## contour3 (peaks (19)); | 54 ## contour3 (peaks (19)); |
55 ## colormap cool; | |
55 ## hold on; | 56 ## hold on; |
56 ## surface (peaks (19), "facecolor", "none", "EdgeColor", "black"); | 57 ## surf (peaks (19), "facecolor", "none", "edgecolor", "black"); |
57 ## colormap hot; | |
58 ## @end group | 58 ## @end group |
59 ## @end example | 59 ## @end example |
60 ## | 60 ## |
61 ## @seealso{contour, contourc, contourf, clabel, meshc, surfc, caxis, colormap, plot} | 61 ## @seealso{contour, contourc, contourf, clabel, meshc, surfc, caxis, colormap, plot} |
62 ## @end deftypefn | 62 ## @end deftypefn |
78 set (0, "currentfigure", oldfig); | 78 set (0, "currentfigure", oldfig); |
79 endif | 79 endif |
80 end_unwind_protect | 80 end_unwind_protect |
81 | 81 |
82 if (! ishold ()) | 82 if (! ishold ()) |
83 set (hax, "view", [-37.5, 30], | 83 set (hax, "view", [-37.5, 30], "box", "off", |
84 "xgrid", "on", "ygrid", "on", "zgrid", "on"); | 84 "xgrid", "on", "ygrid", "on", "zgrid", "on"); |
85 endif | 85 endif |
86 | 86 |
87 if (nargout > 0) | 87 if (nargout > 0) |
88 c = ctmp; | 88 c = ctmp; |
92 endfunction | 92 endfunction |
93 | 93 |
94 | 94 |
95 %!demo | 95 %!demo |
96 %! clf; | 96 %! clf; |
97 %! colormap (cool (64)); | |
98 %! surf (peaks (19), 'facecolor', 'none', 'edgecolor', [0.85 0.85 0.85]); | |
99 %! hold on; | |
97 %! contour3 (peaks (19)); | 100 %! contour3 (peaks (19)); |
98 %! hold on; | 101 %! hold off; |
99 %! surf (peaks (19), 'facecolor', 'none', 'edgecolor', [0.8 0.8 0.8]); | |
100 %! colormap (hot (64)); | |
101 %! axis tight; | 102 %! axis tight; |
102 %! zlim auto; | 103 %! zlim auto; |
103 %! box off; | |
104 %! view (315, 17); | 104 %! view (315, 17); |
105 %! title ('contour3 of peaks() function'); | 105 %! title ({'contour3 of peaks() function', 'gray surf() shows peaks function'}); |
106 %! hold off; | |
107 | 106 |