is an option for GeoGraphics that specifies what parallels and meridians to show.
GeoGridLines
is an option for GeoGraphics that specifies what parallels and meridians to show.
Details
- The following settings can be given for GeoGridLines:
-
None no geo grid lines drawn Automatic geo grid lines placed automatically n approximate number of parallels and meridians Quantity[…] geo grid lines placed at multiples of an angular quantity {latgrid,longrid} geo grid lines specified separately for latitude and longitude - With the Automatic setting, geo grid lines are usually placed at points whose coordinates have the minimum number of digits in their decimal representation.
- For each latitude/longitude coordinate, the following grid line options can be given:
-
None no geo grid lines drawn Automatic geo grid line positions chosen automatically n approximate number of parallels and meridians Quantity[…] geo grid lines placed at multiples of an angular quantity {x1,x2,…} geo grid lines drawn at the specified positions {{x1,style1},…} geo grid lines with specified styles func function to be applied to xmin, xmax to get geo grid line option - When a positive integer n is specified for either latitude or longitude, various heuristics are applied to produce "nice" geo grid lines. As a result, the number of grid lines actually shown may not be exactly n.
- For GeoGridLines->n or GeoGridLines->Automatic, the number of grid lines shown may differ between parallels and meridians.
- For a Quantity specification, only angular quantities are supported.
- The geo grid line function func[xmin,xmax] may return any other geo grid line option.
- AbsoluteOptions can be used to extract explicit lists of latitudes and longitudes that were used for GeoGridLines specifications given Automatic settings.
- Use GeoGridLinesStyle to set styles for geo grid lines.
Examples
open all close allBasic Examples (4)
Overlay a map with geo grid lines using default styling:
GeoGraphics[{Polygon[Entity["Country", "UnitedStates"]]}, GeoGridLines -> Automatic, GeoBackground -> "Plain"]Draw geo grid lines at specific lines of latitude and longitude:
GeoGraphics[{Polygon[Entity["Country", "UnitedStates"]]}, GeoGridLines -> {Range[0, 50, 5], Range[-150, -40, 10]}, GeoGridLinesStyle -> Yellow]GeoGraphics[{Polygon[Entity["Country", "UnitedStates"]]}, GeoGridLines -> Automatic, GeoGridLinesStyle -> Directive[Thick, Dashed, Orange]]Show latitude and longitude lines on Mars, separated by 15 degrees:
GeoGraphics[GeoModel -> "Mars", GeoGridLines -> Quantity[15, "AngularDegrees"], GeoProjection -> "WinkelTripel"]Scope (9)
GeoGridLines Positions (5)
Place the geo grid lines automatically:
GeoGraphics[{Polygon[Entity["Country", "UnitedStates"]]}, GeoGridLines -> Automatic]GeoGraphics[{Polygon[EntityClass["Country", "Europe"]]}, GeoGridLines -> Automatic]GeoGraphics[{GeoStyling[LightRed], Polygon[Entity["Country", "China"]]}, GeoBackground -> GeoStyling["ReliefMap"], GeoGridLines -> Automatic]Draw geo grid lines at specific lines of latitude:
GeoGraphics[{Polygon[Entity["Country", "UnitedStates"]]}, GeoGridLines -> {Range[20, 50, 5], None}, GeoGridLinesStyle -> Gray]Draw geo grid lines at specific lines of longitude:
GeoGraphics[{Polygon[Entity["Country", "UnitedStates"]]}, GeoGridLines -> {None, Range[-150, -40, 10]}, GeoGridLinesStyle -> Magenta]Draw geo grid lines at specific lines of latitude and longitude:
GeoGraphics[{Polygon[Entity["Country", "UnitedStates"]]}, GeoGridLines -> {Range[20, 50, 5], Range[-150, -40, 10]}, GeoGridLinesStyle -> Yellow]Specify the target number of geo grid lines:
GeoGraphics[Entity["Country", "UnitedStates"], GeoGridLines -> 20, GeoGridLinesStyle -> Orange]Specify different numbers of latitude and longitude geo grid lines:
GeoGraphics[Entity["Country", "UnitedStates"], GeoGridLines -> {4, 20}, GeoGridLinesStyle -> Directive[Thin, Orange]]Draw geo grid lines as multiples of a given angle:
GeoGraphics[Entity["Country", "UnitedStates"], GeoGridLines -> Quantity[5, "AngularDegrees"], GeoGridLinesStyle -> Orange]GeoGridLines Styling (4)
Specify the style of each geo grid line:
GeoGraphics[{Polygon[Entity["Country", "UnitedStates"]]}, GeoGridLines -> {{{20, Red}, {30, Orange}, {40, Yellow}, {50, Green}, {60, Blue}}, None}, GeoGridLinesStyle -> Black]With[{p = CountryData["UnitedStates", "CenterCoordinates"]}, GeoGraphics[Entity["Country", "UnitedStates"], GeoGridLines -> {{{p[[1]], Red}}, {{p[[2]], Blue}}}, GeoBackground -> "StreetMapNoLabels", GeoGridLinesStyle -> Black]
]Specify overall geo grid line style using GeoGridLinesStyle:
GeoGraphics[Polygon[EntityClass["Country", "SouthAmerica"]], GeoGridLines -> Automatic, GeoGridLinesStyle -> {Blue, Orange}]Individually styled geo grid lines can be used with GeoGridLinesStyle and have higher priority:
GeoGraphics[Polygon[EntityClass["Country", "SouthAmerica"]], GeoGridLines -> {{-60, {-50, Directive[Thick, Yellow]}, -40, -30, -20, -10, 0, 10, 20, 30}, {-90, -80, -70, {-60, Directive[Thick, Green]}, -50, -40, -30, -20}}, GeoGridLinesStyle -> {Blue, Orange}]Specify a grid function applied to xmin and xmax values of each direction:
grids[min_, max_] := Table[If[EvenQ[i], {i, Red}, {i, Blue}], {i, Ceiling[min], Floor[max], 1}]GeoGraphics[Entity["Country", "Australia"], GeoGridLines -> grids]Applications (2)
Plot a solid line at multiples of 30° and a dashed line at multiples of 10°:
styles[m_] := Table[{c, If[Mod[c, 30] == 0, Directive[Thick, Black], Dashed]}, {c, -m, m, 10}];GeoGraphics[GeoGridLines -> {styles[90], styles[180]}, GeoRange -> "World"]Show geo grid lines on the Bonne projection:
GeoGraphics[GeoGridLines -> Automatic, GeoProjection -> "Bonne", GeoRange -> "World"]AbsoluteOptions[%, GeoGridLines]Properties & Relations (2)
Geo grid lines are always drawn above the graphics:
GeoGraphics[EntityClass["Country", "Europe"], GeoGridLines -> Automatic, GeoBackground -> GeoStyling["ReliefMap"], GeoGridLinesStyle -> Blue]GeoGraphics[EntityClass["Country", "Europe"], GeoGridLines -> Automatic, GeoGridLinesStyle -> Orange]Use AbsoluteOptions to get the grid lines used with an Automatic setting:
GeoGraphics[GeoRange -> "World", GeoGridLines -> Automatic]AbsoluteOptions[%, GeoGridLines]Possible Issues (4)
Specifying GeoGridLinesStyle in addition to a GeoGridLines style may give a different result:
GeoGraphics[{Polygon[Entity["Country", "UnitedStates"]]}, GeoGridLines -> {{{20, Red}, {30, Orange}, {40, Yellow}, {50, Green}, {60, Blue}}, None}, GeoGridLinesStyle -> #]& /@ {Opacity[1], Automatic}Geo grid lines may be specified as an angular quantity:
GeoGraphics[Entity["Country", "UnitedStates"], GeoGridLines -> Quantity[5, "AngularDegrees"]]Geo grid lines may not be specified as a distance quantity:
GeoGraphics[Entity["Country", "UnitedStates"], GeoGridLines -> Quantity[500, "Kilometer"]]Integer arguments and option settings for several geo functions are interpreted as distances (or radii) in meters:
With[{city = Entity["City", {"Rugby", "NorthDakota", "UnitedStates"}]}, GeoGraphics[{GeoDisk[city, 4.4*^6], Red, PointSize[Large], Point[city]}, GeoRange -> 4.5*^6, GeoGridLines -> Automatic]]However, an integer geo grid line specification indicates an approximate number of "nice" grid lines to display:
GeoGraphics[Entity["City", {"Rugby", "NorthDakota", "UnitedStates"}], GeoGridLines -> 5, GeoGridLinesStyle -> Pink]Use GeoPath to interactively display geo coordinates of geo lines:
GeoGraphics[{Table[Tooltip[GeoPath[{"Meridian", lon}], Row[{"lon = ", lon, Degree}]], {lon, -180, 180, 30}], Table[Tooltip[GeoPath[{"Parallel", lat}], Row[{"lat = ", lat, Degree}]], {lat, -90, 90, 15}]}, GeoProjection -> "Bonne"]Neat Examples (3)
A random collection of geo grid lines:
GeoGraphics[GeoRange -> "World", GeoGridLines -> {Table[{RandomReal[{-90, 90}], Hue[RandomReal[]]}, {30}], Table[{RandomReal[{-180, 180}], Hue[RandomReal[]]}, {30}]}]Use geo grid lines with 1° graticule over Australia:
With[{region = Entity["Country", "Australia"]}, With[{ranges = Append[#, 1]& /@ Round[GeoBounds[region]]}, GeoGraphics[{Polygon[region]}, GeoGridLines -> Range@@@ranges, GeoGridLinesStyle -> Directive[Opacity[.5], Yellow], GeoBackground -> GeoStyling["ReliefMap"]]
]
]Plot geo grid lines at positions of the largest US cities:
Length[large = CityData[{Large, "UnitedStates"}]]largest = TakeLargest[EntityValue[large, "Population", "EntityAssociation"], 15]pos = CityData[#, "Coordinates"]& /@ Keys[largest];
points = Tooltip[Point[#1], #2]&@@@Transpose[{GeoPosition /@ pos, Keys@largest}];Display a map of the US with lines of latitude and longitude passing through the largest cities:
GeoGraphics[{Polygon[Entity["Country", "UnitedStates"]], PointSize[Medium], points}, GeoGridLines -> Transpose[pos], GeoBackground -> "ReliefMap", GeoGridLinesStyle -> GrayLevel[0.2, 0.5]]Tech Notes
Related Guides
History
Text
Wolfram Research (2014), GeoGridLines, Wolfram Language function, https://reference.wolfram.com/language/ref/GeoGridLines.html.
CMS
Wolfram Language. 2014. "GeoGridLines." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/GeoGridLines.html.
APA
Wolfram Language. (2014). GeoGridLines. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/GeoGridLines.html
BibTeX
@misc{reference.wolfram_2026_geogridlines, author="Wolfram Research", title="{GeoGridLines}", year="2014", howpublished="\url{https://reference.wolfram.com/language/ref/GeoGridLines.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_geogridlines, organization={Wolfram Research}, title={GeoGridLines}, year={2014}, url={https://reference.wolfram.com/language/ref/GeoGridLines.html}, note=[Accessed: 13-June-2026]}