comparison scripts/plot/util/private/__gnuplot_draw_axes__.m @ 21751:b571fc85953f

maint: Use two spaces after period to indicate sentence break.
author Rik <rik@octave.org>
date Thu, 19 May 2016 18:48:52 -0700
parents 68522e5b74ef
children ffad2baa90f7
comparison
equal deleted inserted replaced
21750:6720e5a220ba 21751:b571fc85953f
818 endif 818 endif
819 819
820 if (isfield (obj, "edgecolor")) 820 if (isfield (obj, "edgecolor"))
821 ## FIXME: This is the wrong thing to do as edgecolor, 821 ## FIXME: This is the wrong thing to do as edgecolor,
822 ## markeredgecolor and markerfacecolor can have different values 822 ## markeredgecolor and markerfacecolor can have different values
823 ## and we should treat them seperately. However, the code below 823 ## and we should treat them seperately. However, the code below
824 ## allows the scatter functions to work as expected, where only 824 ## allows the scatter functions to work as expected, where only
825 ## one of these values is set. 825 ## one of these values is set.
826 if (strcmp (obj.edgecolor, "none")) 826 if (strcmp (obj.edgecolor, "none"))
827 if (strcmp (obj.markeredgecolor, "none")) 827 if (strcmp (obj.markeredgecolor, "none"))
828 ec = obj.markerfacecolor; 828 ec = obj.markerfacecolor;
1304 num_lines += numel (strfind (obj.string, "\n")); 1304 num_lines += numel (strfind (obj.string, "\n"));
1305 else 1305 else
1306 num_lines = numel (obj.string); 1306 num_lines = numel (obj.string);
1307 endif 1307 endif
1308 switch (valign) 1308 switch (valign)
1309 ## Text offset in characters. Relies on gnuplot for font metrics. 1309 ## Text offset in characters. Relies on gnuplot for font metrics.
1310 case "top" 1310 case "top"
1311 dy = -0.5; 1311 dy = -0.5;
1312 case "cap" 1312 case "cap"
1313 dy = -0.5; 1313 dy = -0.5;
1314 case "middle" 1314 case "middle"
1317 dy = 0.5 + (num_lines - 1); 1317 dy = 0.5 + (num_lines - 1);
1318 case "bottom" 1318 case "bottom"
1319 dy = 0.5 + (num_lines - 1); 1319 dy = 0.5 + (num_lines - 1);
1320 endswitch 1320 endswitch
1321 ## Gnuplot's Character units are different for x/y and vary with 1321 ## Gnuplot's Character units are different for x/y and vary with
1322 ## fontsize. The aspect ratio of 1:1.7 was determined by experiment 1322 ## fontsize. The aspect ratio of 1:1.7 was determined by experiment
1323 ## to work for eps/ps/etc. For the MacOS aqua terminal a value of 2.5 1323 ## to work for eps/ps/etc. For the MacOS aqua terminal a value of 2.5
1324 ## is needed. However, the difference is barely noticable. 1324 ## is needed. However, the difference is barely noticeable.
1325 dx_and_dy = [(-dy * sind (angle)), (dy * cosd (angle))] .* [1.7 1]; 1325 dx_and_dy = [(-dy * sind (angle)), (dy * cosd (angle))] .* [1.7 1];
1326 1326
1327 ## FIXME: Multiline text produced the gnuplot 1327 ## FIXME: Multiline text produced the gnuplot
1328 ## "warning: ft_render: skipping glyph" 1328 ## "warning: ft_render: skipping glyph"
1329 if (nd == 3) 1329 if (nd == 3)
2394 else 2394 else
2395 str = [str(1:s(i) - 1), '/=', str(e(i)+b1(1) + 1:e(i)+b2(1)-1), ... 2395 str = [str(1:s(i) - 1), '/=', str(e(i)+b1(1) + 1:e(i)+b2(1)-1), ...
2396 '{}', str(e(i) + b2(1) + 1:end)]; 2396 '{}', str(e(i) + b2(1) + 1:end)];
2397 endif 2397 endif
2398 else 2398 else
2399 ## Last desperate attempt to treat the symbol. Look for things 2399 ## Last desperate attempt to treat the symbol. Look for things
2400 ## like \pix, that should be translated to the symbol Pi and x 2400 ## like \pix, that should be translated to the symbol Pi and x
2401 for j = 1 : length (flds) 2401 for j = 1 : length (flds)
2402 if (strncmp (flds{j}, f, length (flds{j}))) 2402 if (strncmp (flds{j}, f, length (flds{j})))
2403 g = getfield (sym, flds{j}); 2403 g = getfield (sym, flds{j});
2404 ## FIXME: The symbol font doesn't seem to support bold or italic 2404 ## FIXME: The symbol font doesn't seem to support bold or italic
2423 ## But need to put the shorter of the two arguments first. 2423 ## But need to put the shorter of the two arguments first.
2424 ## Careful of nested {} and unprinted characters when defining 2424 ## Careful of nested {} and unprinted characters when defining
2425 ## shortest.. Don't have to worry about things like ^\theta as they 2425 ## shortest.. Don't have to worry about things like ^\theta as they
2426 ## are already converted to ^{/Symbol q}. 2426 ## are already converted to ^{/Symbol q}.
2427 2427
2428 ## FIXME: This is a mess... Is it worth it just for a "@" character? 2428 ## FIXME: This is a mess. Is it worth it just for a "@" character?
2429 2429
2430 [s, m] = regexp (str,'[_\^]','start','matches'); 2430 [s, m] = regexp (str,'[_\^]','start','matches');
2431 i = 1; 2431 i = 1;
2432 p = 0; 2432 p = 0;
2433 while (i < length (s)) 2433 while (i < length (s))