Subscribe to the GIS Tools mailing list, one of several low volume mailing lists alerting you to changes to this site.

Your email address:

 More Info
Scalebar Docs
· Introduction
· Selecting a Style
· Positioning the Scalebar
· Specifying Units
· Displaying the Scale As Text
· Controlling the Number of Intervals
· Text Attributes
· Scalebars With Multiple Units
· Adding a Wrapper to Your Scalebar
· The Scalebar Gallery
Download the AML
Home Page | GIS Tools | Resume | Travel | Site Map
gis tools

Displaying the Scale As Text

It is easy to add the text "Scale 1:nnn" to your scalebar. There are three global variables that control the placement and appearance of the scale text: .scalebar$scalestyle, .scalebar$scaleradix, and .scalebar$scaleround.

The scale text can be displayed either above or below the scalebar. It is always centered with respect to the bar itself, regardless of other settings such as the unit style.

Set the global variable .scalebar$scalestyle to 1 to draw the scale text above the scalebar, and 2 to draw it below. To disable it completely, set .scalebar$scalestyle to 0, which is the default.

To add a radix to the scale, set the variable .scalebar$scaleradix to your radix character. For example, if your scale is 1:1,000,000, setting .scalebar$scaleradix to ',' (with or without the quotes) will yield:

Scale: 1,000,000

To use a space for a radix, set .scalebar$scaleradix to ' ' (a space between two single quotes). That will yield:

Scale: 1 000 000

Finally, you can round off the scale denominator by setting the variable .scalebar$scaleround. The denominator will then round to the nearest multiple of .scalebar$scaleround.

For example, if your mapscale were 1:156,793.6679, and .scalebar$scaleradix were set to ',', you could use .scalebar$scaleround to get the following:

.scalebar$scaleround Result
1 (default) Scale 1:156,794
5 Scale 1:156,795
100 Scale 1:156,800
0 (no rounding) Scale: 156,793.6679

Overriding The Default Mapscale

Most of the time when you are using the scalebar, you will want it to draw at the same scale as the current ArcPlot session. Occasionally, however, you may want to override this behavior. For example, if you are creating a map legend composition or .GRA file to place on your map, the ArcPlot mapscale setting may not be the same as that used for the rest of the map. An easy way to get a correct scalebar in this situation is to use the .scalebar$mapscale parameter. If this variable contains a value, it will be used as the mapscale. Otherwise, the scalebar will be drawn using the underlying mapscale. If you set .scalebar$mapscale to 2400, for example, the scalebar will be drawn at 1:2400 regardless of the current ArcPlot mapscale setting.

Top of page | Next: Controlling the Number of Intervals
Green Tea

Comments or questions to: