Menu

#463 Legend location documentation is incorrect

open
nobody
None
5
2009-11-10
2009-11-10
No

Legend location options in the documentation says:

"where option takes on the following possible values
north,N - top center of plot
south,S - bottom center of plot
east,E - middle right of plot
west,W - middle left of plot
northeast,NE - top right of plot (default behavior)
northwest,NW - top left of plot
southeast,SE - bottom right of plot
southwest,SW - bottom left of plot "

But using any of those given options names results in an error.

The correct options are as dictated here: http://freemat.sourcearchive.com/documentation/3.6plus-pdfsg/legend_8m-source.html

" switch(legend_position)
case 'n'
set(cba,'outerposition',[cx-lw/2,ty-lh,lw,lh]);
case 's'
set(cba,'outerposition',[cx-lw/2,by,lw,lh]);
case 'e'
set(cba,'outerposition',[rx-lw,cy-lh/2,lw,lh]);
case 'w'
set(cba,'outerposition',[lx,cy-lh/2,lw,lh]);
case 'ne'
set(cba,'outerposition',[rx-lw,ty-lh,lw,lh]);
case 'se'
set(cba,'outerposition',[rx-lw,by,lw,lh]);
case 'sw'
set(cba,'outerposition',[lx,by,lw,lh]);
case 'nw'
set(cba,'outerposition',[lx,ty-lh,lw,lh]);
otherwise
error('Unrecognized position tag for legend');
end
axes(axhan);
"

That is, the lowercase letters associated with the locations yield plots with correctly placed legend.

Easy to fix, I would think. Thanks.

Discussion


Log in to post a comment.