# HG changeset patch # User Ben Abbott # Date 1288243369 -28800 # Node ID 2e32236eaa90d6b4b00bfd7648f34da8583b7dee # Parent 131d56b6d9a3ffb39e08ea21a846f6cd7e42bc7e Add demos setting both data and plotbox aspect ratios. diff --git a/scripts/ChangeLog b/scripts/ChangeLog --- a/scripts/ChangeLog +++ b/scripts/ChangeLog @@ -1,3 +1,8 @@ +2010-10-28 Ben Abbott + + * plot/daspect.m, plot/pbaspect.m: Add demos setting both data and + plotbox aspect ratios. + 2010-10-27 David Bateman * plot/private/__patch__.m (setdata, setvertexdata): If argments are diff --git a/scripts/plot/daspect.m b/scripts/plot/daspect.m --- a/scripts/plot/daspect.m +++ b/scripts/plot/daspect.m @@ -104,6 +104,14 @@ %! x = 0:0.01:4; %! clf %! plot (x, cos (x), x, sin (x)) +%! daspect ([1 1 1]) +%! pbaspect ([2 1 1]) +%! title ("2x1 plot box with axis limits [0, 4, -2, 2]") + +%!demo +%! x = 0:0.01:4; +%! clf +%! plot (x, cos (x), x, sin (x)) %! axis square %! set (gca, "activepositionproperty", "position") %! daspect ([1 1 1]) diff --git a/scripts/plot/pbaspect.m b/scripts/plot/pbaspect.m --- a/scripts/plot/pbaspect.m +++ b/scripts/plot/pbaspect.m @@ -89,12 +89,20 @@ %! clf %! plot (x, cos (x), x, sin (x)) %! pbaspect ([1 1 1]) -%! title ('plot box should be square') +%! title ("plot box should be square") %!demo %! x = 0:0.01:4; %! clf %! plot (x, cos (x), x, sin (x)) %! pbaspect ([2 1 1]) -%! title ('plot box aspect ratio should be 2x1') +%! title ("plot box aspect ratio should be 2x1") +%!demo +%! x = 0:0.01:4; +%! clf +%! plot (x, cos (x), x, sin (x)) +%! daspect ([1 1 1]) +%! pbaspect ([2 1 1]) +%! title ("plot box should be 2x1, and axes [0 4 -1 1]") +