Code covered by the BSD License  

Highlights from
scalebar for maps

Be the first to rate this file! 20 Downloads (last 30 days) File Size: 2.25 KB File ID: #43500
image thumbnail

scalebar for maps



A simpler alternative to the built-in Mapping Toolbox function scaleruler.

| Watch this File

File Information

The scaleruler function in the Mapping Toolbox is powerful, but it can be a bit clunky and difficult to work with. This scalebar function is a simpler, less powerful alternative. Simply type "scalebar" for a 100 km scale bar in the lower left corner of your map. For more complex preferences, try any of these:

scalebar('length',200) for a 200 km scale bar.

scalebar('length,200,'color','blue') for a blue one (shown in the image of Texas above).

scalebar('location','southeast','fontangle','italic') places a scale bar in the lower right corner with italic text.

Keep adding linespec or text property commands as name-value pairs. Can also create a vertical scalebar with 'orientation','vertical'.

Disclaimer: This scale bar is intended to show approximate distances. The scale is inexact, and errors increase with the size of any map. In fact, it's probably poor practice to put any scale reference on a map of an area as large as Texas. Nonetheless, this scalebar function will display a ballpark size reference.

Required Products Mapping Toolbox
MATLAB release MATLAB 8.0 (R2012b)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.

Contact us