Mercurial > hg > octave-nkf
comparison scripts/plot/axis.m @ 10532:568c7c041fac
colorbar.m: Consistent treatment of plotboxaspectratio. Add listener for plotboxaspectratiomode.
author | Ben Abbott <bpabbott@mac.com> |
---|---|
date | Mon, 19 Apr 2010 07:22:30 -0400 |
parents | 2884758e265b |
children | 95c3e38098bf |
comparison
equal
deleted
inserted
replaced
10531:2dd8ea8bfd71 | 10532:568c7c041fac |
---|---|
162 ## aspect ratio | 162 ## aspect ratio |
163 elseif (strcmpi (ax, "image")) | 163 elseif (strcmpi (ax, "image")) |
164 __axis__ (ca, "equal") | 164 __axis__ (ca, "equal") |
165 __do_tight_option__ (ca); | 165 __do_tight_option__ (ca); |
166 elseif (strcmpi (ax, "square")) | 166 elseif (strcmpi (ax, "square")) |
167 if (__gnuplot_has_feature__ ("screen_coordinates_for_{lrtb}margin")) | 167 set (ca, "plotboxaspectratio", [1, 1, 1]); |
168 set (ca, "plotboxaspectratio", [1, 1, 1]); | |
169 else | |
170 x = xlim; | |
171 y = ylim; | |
172 set (ca, "plotboxaspectratio", [(y(2)-y(1)), (x(2)-x(1)), 1]); | |
173 endif | |
174 elseif (strcmp (ax, "equal")) | 168 elseif (strcmp (ax, "equal")) |
175 if (__gnuplot_has_feature__ ("screen_coordinates_for_{lrtb}margin")) | 169 x = xlim; |
176 x = xlim; | 170 y = ylim; |
177 y = ylim; | 171 set (ca, "plotboxaspectratio", [(x(2)-x(1)), (y(2)-y(1)), 1]); |
178 set (ca, "plotboxaspectratio", [(x(2)-x(1)), (y(2)-y(1)), 1]); | |
179 else | |
180 set (ca, "plotboxaspectratio", [1, 1, 1]); | |
181 endif | |
182 elseif (strcmpi (ax, "normal")) | 172 elseif (strcmpi (ax, "normal")) |
183 set (ca, "plotboxaspectratiomode", "auto"); | 173 set (ca, "plotboxaspectratiomode", "auto"); |
184 | 174 |
185 ## axis limits | 175 ## axis limits |
186 elseif (len >= 4 && strcmpi (ax(1:4), "auto")) | 176 elseif (len >= 4 && strcmpi (ax(1:4), "auto")) |