changeset 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 04f4f067eb33
children 8f9ed9d8a478
files scripts/plot/legend.m
diffstat 1 files changed, 83 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/plot/legend.m	Sat Jul 06 04:08:17 2013 +0100
+++ b/scripts/plot/legend.m	Sat Jul 06 11:54:31 2013 -0400
@@ -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);