comparison scripts/plot/private/__go_draw_axes__.m @ 16002:cddf9103a566

Fix legend bugs (#38263, #38265). * scripts/plot/legend.m: Add listener for the legend hggroup "fontsize" property, and add "fontsize" to the updated properties. * scripts/plot/private/__go_draw_axes__.m: Limited supprt for changing the color of the legend's text labels.
author Ben Abbott <bpabbott@mac.com>
date Tue, 05 Feb 2013 10:56:46 -0500
parents 7275cfaddb5e
children 1e35b64ac31a
comparison
equal deleted inserted replaced
16001:7275cfaddb5e 16002:cddf9103a566
1589 [fontname, fontsize] = get_fontname_and_size (hlgnd); 1589 [fontname, fontsize] = get_fontname_and_size (hlgnd);
1590 fontspec = create_fontspec (fontname, fontsize, gnuplot_term); 1590 fontspec = create_fontspec (fontname, fontsize, gnuplot_term);
1591 else 1591 else
1592 fontspec = ""; 1592 fontspec = "";
1593 endif 1593 endif
1594 colorspec = get_text_colorspec (hlgnd.textcolor, mono); 1594 textcolors = get (findobj (hlgnd.children, "type", "text"), "color");
1595 if (iscell (textcolors))
1596 textcolors = cell2mat (textcolors);
1597 textcolors = unique (textcolors, "rows");
1598 endif
1599 if (rows (textcolors) > 1)
1600 ## Gnuplot is unable to assign arbitrary colors to each text entry
1601 ## for the key/legend. But, the text color can be set to match the
1602 ## color of the plot object.
1603 colorspec = "textcolor variable";
1604 else
1605 colorspec = get_text_colorspec (textcolors, mono);
1606 endif
1595 fprintf (plot_stream, "set key %s %s;\nset key %s %s %s %s %s;\n", 1607 fprintf (plot_stream, "set key %s %s;\nset key %s %s %s %s %s;\n",
1596 inout, pos, box, reverse, horzvert, fontspec, colorspec); 1608 inout, pos, box, reverse, horzvert, fontspec, colorspec);
1597 else 1609 else
1598 fputs (plot_stream, "unset key;\n"); 1610 fputs (plot_stream, "unset key;\n");
1599 endif 1611 endif