# coyote: FIXED_MAP_GRID

- coyote/Mapping
- [Source code]

NAME

      FIXED_MAP_GRID

PURPOSE

      The MAP_GRID procedure draws the graticule of parallels and meridians,

according to the specifications established by MAP_SET. MAP_SET must be called

before MAP_GRID to establish the projection type, the center of the

projection, polar rotation and geographical limits.

CATEGORY

      Mapping.

CALLING SEQUENCE

      MAP_GRID

INPUTS

      NONE

OPTIONAL INPUTS

      NONE

KEYWORD PARAMETERS

BOX_AXES

       Surround the map window with a "box" style axes withannotations, outside the box, where the parallels intersect the
      sides, and the meridians intersect the bottom and top edges of the
      box.  The border of the box is drawn in alternating foreground and
      background colors, with color changes at each intersection with
      a parallel or meridian.  This keyword determines the thickness of
      the box's border, in millimeters.  If LABEL is not explicitly
      specified, it defaults to 1 when this keyword is present.  If this
      feature is selected, be sure to leave enough room around the map
      window for the annotation, usually by specifying the XMARGIN and
      YMARGIN keywords to MAP_SET.  See the example below.
      ZE: The size of the characters used for the labels. The default is 1.
      OR: The color index for the grid lines.

FILL_HORIZON

       Fills the current map_horizon.HORIZON: Draws the current map horizon.
      CREMENT: Determines the spacing between graticle points.

GLINESTYLE

       If set, the line style used to draw the grid of parallels andmeridians. See the IDL User's Guide for options. The default is
      dotted.

GLINETHICK

       The thickness of the grid lines. Default is 1.LABEL: Set this keyword to label the parallels and meridians with their
             corresponding latitudes and longitudes. Setting this keyword to
             an integer will cause every LABEL gridline to be labeled (i.e,
             if LABEL=3 then every third gridline will be labeled). The
             starting point for determining which gridlines are labeled is the
             minimum latitude or longitude (-180 to 180), unless the LATS or
             LONS keyword is set to a single value. In this case, the starting
             point is the value of LATS or LONS.
      ALIGN: This keyword controls the alignment of the text baseline for
             latitude labels. A value of 0.0 left justifies the label,
             1.0 right justifies it, and 0.5 centers it.
      ATDEL: The spacing in degrees between parallels of latitude in the grid.
             If not set, a suitable value is determined from the current map
             projection.
       LATS: The desired latitudes to be drawn (and optionally labeled). If
             this keyword is omitted, appropriate latitudes will be generated
             with consideration of the optional LATDEL keyword. If this
             keyword is set to a single value, drawn (and optionally labeled)
             latitudes will be automatically generated  as
             [...,LATS-LATDEL,LATS,LATS+LATDEL,...] over the extent of the
             map.  The single valued LATS is taken to be the starting point
             for labelling (See the LABEL keyword).
      ATLAB: The longitude at which to place latitude labels. The default is
             the center longitude on the map.
      NAMES: An array specifing the names to be used for the latitude labels.
             By default, this array is automatically generated in units of
             degrees. This array can be a string array or numeric, but should
             not be of mixed type. When LATNAMES is specified, LATS must also
             be specified, but the number of elments in the two arrays need not
             be equal. Extra LATNAMES are ignored, while LATNAMES not supplied
             are automatically reported in degrees. LATNAMES can be used when
             LATS is set to a single value. It this case, the LATS used will
             start at the specified latitude and progress northward, wrapping
             around the globe if appropriate. Caution should be used when
             using LATNAMES in conjunction with a single LATS, since the
             number of visible latitude gridlines is dependent on many factors.
      ALIGN: This keyword controls the alignment of the text baseline for
             longitude labels. A value of 0.0 left justifies the label,
             1.0 right justifies it, and 0.5 centers it.
      ONDEL: The spacing in degrees between meridians of longitude in the grid.
             If not set, a suitable value is determined from the current map
             projection.
      ONLAB: The latitude at which to place longitude labels. The default is
             the center latitude on the map.
       LONS: The desired longitudes to be drawn (and optionally labeled). If
             this keyword is omitted, appropriate longitudes will be generated
             with consideration of the optional LONDEL keyword. If this
             keyword is set to a single value, drawn (and optionally labeled)
             longitudes will be automatically generated as
             [...,LONS-LONDEL,LONS,LONS+LONDEL,...] over the extent of the map.
             The single valued LONS is taken to be the starting point for
             labeling (See the LABEL keyword).
      NAMES: An array specifing the names to be used for the longitude labels.
             By default, this array is automatically generated in units of
             degrees. This array can be a string array or numeric, but should
             not be of mixed type. When LONNAMES is specified, LATS must also
             be specified, but the number of elments in the two arrays need not
             be equal. Extra LONNAMES are ignored, while LATNAMES not supplied
             are automatically reported in degrees. LONNAMES can be used when
             LONS is set to a single value. It this case, the LONS used will
             start at the specified longitude and progress eastward, wrapping
             around the globe if appropriate. Caution should be used when
             using LONNAMES in conjunction with a single LONS, since the number
             of visible longitude gridlines is dependent on many factors.

MAP_STRUCTURE

       Set this keyword to a !MAP structure, as returned fromMAP_PROJ_INIT. If this keyword is set then the gridlines are passed
      through MAP_PROJ_FORWARD and the resulting lines are drawn using
      Cartesian coordinates. If this keyword is not set then it is assumed
      that MAP_SET has been called to set up a map projection.

NO_GRID

       Set this keyword if you only want labels but not gridlines.

ORIENTATION

       Specifies the clockwise angle in degrees from horizontalof the text baseline that the labels should be rotated. Note,
      that the rotation used in MAP_SET is also clockwise, but XYOUTS
      is normally counterclockwise.

T3D

       Set this keyword to indicate that the generalized transformationmatrix in !P.T is to be used. If not present, the user-supplied
      coordinates are simply scaled to screen coordinates.

ZVALUE

       Sets the Z coordinate, in normalized coordinates in therange of 0 to 1, at which to output the continents.
      e - This keyword has effect only if keyword T3D is set and the
      transformation is stored in !P.T

OUTPUTS

      Draws gridlines and labels on the current map.

EXAMPLE

      map_set,10,20,23.5,/cont,/ortho,/horizon     ; establish a projection
          lats=[-65,-52,-35,-20,-2.59,15,27.6,35,45,55,75,89]
                      ; choose the parallels to draw
          map_grid,lats=lats,londel=20,lons=-13,label=2,lonlab=-2.5,latlab=7
                      ;draw the grid
      ke a map with a grid surrounded by a box style axis:
      p_set, /STEREO, 40, -90,scale=50e6,/CONTINENTS, XMARGIN=3, YMARGIN=3
      p_grid, /BOX_AXES, COLOR=3, CHARSIZE=1.5  ;

MODIFICATION HISTORY

      Written by: SVP, May, 23 1996.
      DMS, Feb, 1996 Note that this version plots all gridlines
              unless a 4 element LIMIT was specified to MAP_SET.
          SVP, Nov 1996   Changed over !map1 (new IDL5 maps)
      SVP, May 1996   Map_Grid used to live inside of map_set.pro, now
                          it lives here.
          SVP, May 1996   Changed LABEL to determine the skip between labelled
                          gridlines.
                          Also, added the LATS and LONS keywords to give complete
                          control over where the labels go.
          SVP, Sept 1996  Added LATNAMS,LONAMES, and ORIENTATION keywords
      DMS, Nov, 1996  Rev 2 of maps.
      DMS, Jul, 1997  Added Box Axes
      CT, Jan 2004: Added MAP_STRUCTURE keyword.
      Renamed the function FIXED_MAP_GRID with fixed at lines 555-556 and
         664-665 as described here: http://www.dfanning.com/map_tips/missinggrid.html.
         This is required to get proper grid output in some applications, but
         it breaks other code.