Products & Services Solutions Academia Support User Community Company

Learn more about Mapping Toolbox   

clegendm - Add legend labels to map contour display

Syntax

clegendm(cs,h)
clegendm(cs,h,pos)
clegendm(...,unitstr)
clegendm(...,str)

Description

The clegendm function displays a legend for a displayed contour map.

clegendm(cs,h) displays a legend for the contour map defined by the two-column contour definition matrix, cs, and the handle(s) h. Both of these inputs are produced as the outputs of either contourm or contour3m.

clegendm(cs,h,pos) allows you to specify the position of the legend in the display. The input pos can be any of the following integers, with the indicated result:

0

Automatic placement (this is the default)

1

Upper right corner

2

Upper left corner

3

Lower left corner

4

Lower right corner

-1

To the right of the plot

clegendm(...,unitstr) appends the character string unitstr to each entry in the legend.

clegendm(...,str) uses the strings specified in cell array str to label the legend. The cell array must have same number of entries as h.

Examples

load topo
axesm robinson; framem
[cs,h] = contourm(topo,topolegend,3);
clegendm(cs,h,2)

% Example showing legend string usage
% Load topographic data measured in meters                                 
load topo;                                                                 
axesm robinson; framem                                                     
[cs,h] = contourm(topo,topolegend,3); 
% Create Legend with user specified string
str = {'low altitude','medium altitude','high altitude'}
clegendm(cs,h,2,str);

See Also

clabelm, contourm, contour3m, contourc (MATLAB function)

  


Recommended Products

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.

 © 1984-2009- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS