comparison scripts/plot/appearance/axis.m @ 19630:0e1f5a750d00

maint: Periodic merge of gui-release to default.
author John W. Eaton <jwe@octave.org>
date Tue, 20 Jan 2015 10:24:46 -0500
parents 7bbe3658c5ef 446c46af4b42
children 4197fc428c7d
comparison
equal deleted inserted replaced
19626:37d37297acf8 19630:0e1f5a750d00
200 ## aspect related magnitudes even if the aspect ratio is the same 200 ## aspect related magnitudes even if the aspect ratio is the same
201 ## (useful with the x11 gnuplot terminal after a window resize) 201 ## (useful with the x11 gnuplot terminal after a window resize)
202 set (ca, "dataaspectratiomode", "auto"); 202 set (ca, "dataaspectratiomode", "auto");
203 endif 203 endif
204 set (ca, "dataaspectratio", [1, 1, 1], "plotboxaspectratio", [5 4 4]); 204 set (ca, "dataaspectratio", [1, 1, 1], "plotboxaspectratio", [5 4 4]);
205 205
206 elseif (strcmpi (ax, "normal")) 206 elseif (strcmpi (ax, "normal"))
207 ## Set plotboxaspectratio to something obtuse so that switching 207 ## Set plotboxaspectratio to something obtuse so that switching
208 ## back to "auto" will force a re-calculation. 208 ## back to "auto" will force a re-calculation.
209 set (ca, "plotboxaspectratio", [3 2 1]); 209 set (ca, "plotboxaspectratio", [3 2 1]);
210 set (ca, "plotboxaspectratiomode", "auto", 210 set (ca, "plotboxaspectratiomode", "auto",
333 ## Return the current limits. 333 ## Return the current limits.
334 lims = get (ca, strcat (ax, "lim")); 334 lims = get (ca, strcat (ax, "lim"));
335 else 335 else
336 data = get (kids, strcat (ax, "data")); 336 data = get (kids, strcat (ax, "data"));
337 types = get (kids, "type"); 337 types = get (kids, "type");
338 338
339 scale = get (ca, strcat (ax, "scale")); 339 scale = get (ca, strcat (ax, "scale"));
340 if (! iscell (data)) 340 if (! iscell (data))
341 data = {data}; 341 data = {data};
342 endif 342 endif
343 343
344 ## Extend image data one pixel 344 ## Extend image data one pixel
345 idx = strcmp (types, "image"); 345 idx = strcmp (types, "image");
346 if (any (idx) && (ax == "x" || ax == "y")) 346 if (any (idx) && (ax == "x" || ax == "y"))
347 imdata = data(idx); 347 imdata = data(idx);
348 px = arrayfun (@__image_pixel_size__, kids(idx), "uniformoutput", false); 348 px = arrayfun (@__image_pixel_size__, kids(idx), "uniformoutput", false);
349 ipx = ifelse (ax == "x", 1, 2); 349 ipx = ifelse (ax == "x", 1, 2);
350 imdata = cellfun (@(x,dx) [(min (x) - dx(ipx)), (max (x) + dx(ipx))], 350 imdata = cellfun (@(x,dx) [(min (x) - dx(ipx)), (max (x) + dx(ipx))],
351 imdata, px, "uniformoutput", false); 351 imdata, px, "uniformoutput", false);
352 data(idx) = imdata; 352 data(idx) = imdata;
353 endif 353 endif
354 354
355 if (strcmp (scale, "log")) 355 if (strcmp (scale, "log"))
356 tmp = data; 356 tmp = data;
357 data = cellfun (@(x) x(x>0), tmp, "uniformoutput", false); 357 data = cellfun (@(x) x(x>0), tmp, "uniformoutput", false);
358 n = cellfun ("isempty", data); 358 n = cellfun ("isempty", data);
359 data(n) = cellfun (@(x) x(x<0), tmp(n), "uniformoutput", false); 359 data(n) = cellfun (@(x) x(x<0), tmp(n), "uniformoutput", false);