Mercurial > hg > octave-lyh
diff scripts/plot/legend.m @ 16908:1c4be5dcacd5
Add demos to legend.m using subplots.
scripts/plot/legend.m: Add demos using subplots.
author | Ben Abbott <bpabbott@mac.com> |
---|---|
date | Sat, 06 Jul 2013 11:54:31 -0400 |
parents | fb80e1891cf9 |
children | 8f9ed9d8a478 |
line wrap: on
line diff
--- a/scripts/plot/legend.m +++ b/scripts/plot/legend.m @@ -1416,15 +1416,21 @@ %! option = 'right'; %! subplot (3,1,1); %! plot (rand (1,4)); +%! xlabel xlabel +%! ylabel ylabel %! title ('Subplots should adjust to the legend placed outside'); %! legend ({'1'}, 'location', 'northeastoutside'); %! legend (option); %! subplot (3,1,2); %! plot (rand (1,4)); +%! xlabel xlabel +%! ylabel ylabel %! legend ({'1234567890'}, 'location', 'eastoutside'); %! legend (option); %! subplot (3,1,3); %! plot (rand (1,4)); +%! xlabel xlabel +%! ylabel ylabel %! legend ({'12345678901234567890'}, 'location', 'southeastoutside'); %! legend (option); @@ -1445,3 +1451,80 @@ %! legend ({'12345678901234567890'}, 'location', 'southwestoutside'); %! legend (option); +%!demo % bug 36408 +%! clf; +%! option = 'right'; +%! subplot (3,1,1); +%! plot (rand (1,4)); +%! set (gca (), "yaxislocation", "right") +%! xlabel ('xlabel') +%! ylabel ('ylabel') +%! title ('Subplots should adjust to the legend placed outside'); +%! legend ({'1'}, 'location', 'northeastoutside'); +%! legend (option); +%! subplot (3,1,2); +%! plot (rand (1,4)); +%! set (gca (), "yaxislocation", "right") +%! xlabel ('xlabel') +%! ylabel ('ylabel') +%! legend ({'1234567890'}, 'location', 'eastoutside'); +%! legend (option); +%! subplot (3,1,3); +%! plot (rand (1,4)); +%! set (gca (), "yaxislocation", "right") +%! xlabel ('xlabel') +%! ylabel ('ylabel') +%! legend ({'12345678901234567890'}, 'location', 'southeastoutside'); +%! legend (option); + +%!demo % bug 36408 +%! clf; +%! option = 'right'; +%! subplot (3,1,1) +%! plot (rand (1,4)); +%! set (gca (), "yaxislocation", "right") +%! xlabel ('xlabel') +%! ylabel ('ylabel') +%! title ('Subplots should adjust to the legend placed outside'); +%! legend ({'1'}, 'location', 'northwestoutside'); +%! legend (option); +%! subplot (3,1,2); +%! plot (rand (1,4)); +%! set (gca (), "yaxislocation", "right") +%! xlabel ('xlabel') +%! ylabel ('ylabel') +%! legend ({'1234567890'}, 'location', 'westoutside'); +%! legend (option); +%! subplot (3,1,3); +%! plot (rand (1,4)); +%! set (gca (), "yaxislocation", "right") +%! xlabel ('xlabel') +%! ylabel ('ylabel') +%! legend ({'12345678901234567890'}, 'location', 'southwestoutside'); +%! legend (option); + +%!demo % bug 36408 +%! clf; +%! option = 'right'; +%! subplot (3,1,1) +%! plot (rand (1,4)); +%! set (gca (), "xaxislocation", "top") +%! xlabel ('xlabel') +%! ylabel ('ylabel') +%! title ('Subplots should adjust to the legend placed outside'); +%! legend ({'1'}, 'location', 'northwestoutside'); +%! legend (option); +%! subplot (3,1,2); +%! plot (rand (1,4)); +%! set (gca (), "xaxislocation", "top") +%! xlabel ('xlabel') +%! ylabel ('ylabel') +%! legend ({'1234567890'}, 'location', 'westoutside'); +%! legend (option); +%! subplot (3,1,3); +%! plot (rand (1,4)); +%! set (gca (), "xaxislocation", "top") +%! xlabel ('xlabel') +%! ylabel ('ylabel') +%! legend ({'12345678901234567890'}, 'location', 'southwestoutside'); +%! legend (option);