Legend order for vertical string cell.

Daniel J Sebald daniel.sebald at ieee.org
Mon Dec 29 20:53:12 CST 2008


Ben,

This patch to the legend script:

http://hg.savannah.gnu.org/hgweb/octave/rev/9f34f7636fe0

fixed the case of horizontal string cells, but not vertical string cells.  Try something like:

x = [0:0.1:1]';
Y = [x sin(x)];
C = {'x', 'sine'};
plot(x, Y, '-');
legend(C);
pause;
C = {'x'; 'sinusoid'};
legend(C);

I've attached two patches to pick which way to fix this.  Either with a rot90() or indexing backward through the cell...  I suppose one should try

legend('x', 'sin(x)');

to make sure the order is also correct for non-cell entries.  (I don't have a recent version on this machine.)

Dan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: legend_djs_29dec2008_1.patch
Type: text/x-patch
Size: 1156 bytes
Desc: not available
Url : https://www-old.cae.wisc.edu/pipermail/octave-maintainers/attachments/20081229/30c288e5/attachment.bin 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: legend_djs_29dec2008_2.patch
Type: text/x-patch
Size: 1297 bytes
Desc: not available
Url : https://www-old.cae.wisc.edu/pipermail/octave-maintainers/attachments/20081229/30c288e5/attachment-0001.bin 


More information about the Octave-maintainers mailing list