Mercurial > octave-dspies
comparison scripts/plot/appearance/legend.m @ 18889:b6fdfe22634b
legend.m: Make demos using 'location' property compatible with Matlab.
* legend.m: Use 'location' property in a Matlab compatible way in %!demo block
so that output can be compared with Octave.
author | Rik <rik@octave.org> |
---|---|
date | Thu, 03 Jul 2014 08:46:19 -0700 |
parents | 962db83e36c3 |
children | 961ecaf9fb57 |
comparison
equal
deleted
inserted
replaced
18888:962db83e36c3 | 18889:b6fdfe22634b |
---|---|
1246 %!demo | 1246 %!demo |
1247 %! clf; | 1247 %! clf; |
1248 %! plot (rand (2)); | 1248 %! plot (rand (2)); |
1249 %! title ('legend called with cellstr and string inputs for labels'); | 1249 %! title ('legend called with cellstr and string inputs for labels'); |
1250 %! h = legend ({'foo'}, 'bar'); | 1250 %! h = legend ({'foo'}, 'bar'); |
1251 %! legend location northeastoutside | 1251 %! legend (h, 'location', 'northeastoutside'); |
1252 %! set (h, 'fontsize', 20); | 1252 %! set (h, 'fontsize', 20); |
1253 | 1253 |
1254 %!demo | 1254 %!demo |
1255 %! clf; | 1255 %! clf; |
1256 %! plot (rand (3)); | 1256 %! plot (rand (3)); |
1259 | 1259 |
1260 %!demo | 1260 %!demo |
1261 %! clf; | 1261 %! clf; |
1262 %! x = 0:1; | 1262 %! x = 0:1; |
1263 %! plot (x,x,';I am Blue;', x,2*x, x,3*x,';I am Red;'); | 1263 %! plot (x,x,';I am Blue;', x,2*x, x,3*x,';I am Red;'); |
1264 %! legend location northeastoutside | 1264 %! h = legend ('location', 'northeastoutside'); |
1265 %! ## Placing legend inside should return axes to original size | 1265 %! ## Placing legend inside should return axes to original size |
1266 %! legend location northeast | 1266 %! legend (h, 'location', 'northeast'); |
1267 %! title ('Blue and Red keys, with Green missing'); | 1267 %! title ('Blue and Red keys, with Green missing'); |
1268 | 1268 |
1269 %!demo | 1269 %!demo |
1270 %! clf; | 1270 %! clf; |
1271 %! plot (1:10, 1:10, 1:10, fliplr (1:10)); | 1271 %! plot (1:10, 1:10, 1:10, fliplr (1:10)); |