是 GeoGraphics 的一个选项,指定显示什么纬线和经线.
GeoGridLines
是 GeoGraphics 的一个选项,指定显示什么纬线和经线.
更多信息
- 可以对 GeoGridLines 给出下列设置:
-
None 不绘制地理网格线 Automatic 自动放置的地理网格线 n 纬线和经线的近似数目 Quantity[…] 在某角度的倍数上放置的地理网格线 {latgrid,longrid} 对纬度和经度分别指定的地理网格线 - 在 Automatic 设置下,地理网格线通常放在以十进制表示时具有最少数位的坐标点.
- 对于每个纬度/经度坐标,可以给出下列网格线选项:
-
None 不绘制地理网格线 Automatic 自动选择网格线位置 n 纬线和经线的近似数目 Quantity[…] 放置在角度量倍数处的地理网格线 {x1,x2,…} 在指定位置绘制的地理网格线 {{x1,style1},…} 具有指定样式的地理网格线 func 应用于 xmin、xmax,以获得地理网格线选项的函数 - 当对纬度或者经度指定一个正整数 n,会用各种启发式方法以产生“好”的地理网格线. 结果就是实际上显示的网格线数目可能不恰好是 n.
- 对于 GeoGridLines->n 或者 GeoGridLines->Automatic,纬线和经线显示的网格线数目可能不同.
- 对于 Quantity 规范,只支持用角度测量的数量.
- 地理网格线函数 func[xmin,xmax] 可能返回任何其他地理网格线选项.
- AbsoluteOptions 可用于提取纬度和经度的显式列表,被用于给定 Automatic 设置下的 GeoGridLines 规范.
- 使用 GeoGridLinesStyle 设置地理网格线的样式.
范例
打开所有单元 关闭所有单元基本范例 (3)
GeoGraphics[{Polygon[Entity["Country", "UnitedStates"]]}, GeoGridLines -> Automatic, GeoBackground -> "Plain"]GeoGraphics[{Polygon[Entity["Country", "UnitedStates"]]}, GeoGridLines -> Automatic, GeoProjection -> "Albers", GeoBackground -> "Basic"]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]]范围 (8)
GeoGridLines 位置 (5)
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]GeoGraphics[{Polygon[Entity["Country", "UnitedStates"]]}, GeoGridLines -> {Range[20, 50, 5], None}, GeoGridLinesStyle -> Gray]GeoGraphics[{Polygon[Entity["Country", "UnitedStates"]]}, GeoGridLines -> {None, Range[-150, -40, 10]}, GeoGridLinesStyle -> Magenta]GeoGraphics[{Polygon[Entity["Country", "UnitedStates"]]}, GeoGridLines -> {Range[20, 50, 5], Range[-150, -40, 10]}, GeoGridLinesStyle -> Yellow]GeoGraphics[Entity["Country", "UnitedStates"], GeoGridLines -> 20, GeoGridLinesStyle -> Orange]GeoGraphics[Entity["Country", "UnitedStates"], GeoGridLines -> {4, 20}, GeoGridLinesStyle -> Directive[Thin, Orange]]GeoGraphics[Entity["Country", "UnitedStates"], GeoGridLines -> Quantity[5, "AngularDegrees"], GeoGridLinesStyle -> Orange]GeoGridLines 样式 (3)
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 -> GeoStyling["StreetMap"], GeoGridLinesStyle -> Black]
]用 GeoGridLinesStyle 指定整体地理网格线样式:
GeoGraphics[Polygon[EntityClass["Country", "SouthAmerica"]], GeoGridLines -> Automatic, GeoGridLinesStyle -> {Blue, Orange}]可以和 GeoGridLinesStyle 一起使用单独样式的地理网格线,并且具有较高的优先级:
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}]推广和延伸 (1)
应用 (2)
在 30° 的倍数上绘制实线,在 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"]GeoGraphics[GeoGridLines -> Automatic, GeoProjection -> "Bonne", GeoRange -> "World"]AbsoluteOptions[%, GeoGridLines]属性和关系 (2)
GeoGraphics[EntityClass["Country", "Europe"], GeoGridLines -> Automatic, GeoBackground -> GeoStyling["ReliefMap"], GeoGridLinesStyle -> Blue]GeoGraphics[EntityClass["Country", "Europe"], GeoGridLines -> Automatic, GeoGridLinesStyle -> Orange]使用 AbsoluteOptions 获得在 Automatic 设置下使用的网格线:
GeoGraphics[GeoRange -> "World", GeoGridLines -> Automatic]AbsoluteOptions[%, GeoGridLines]可能存在的问题 (4)
在 GeoGridLines 样式下,指定 GeoGridLinesStyle 样式可能会给出不同的结果:
GeoGraphics[{Polygon[Entity["Country", "UnitedStates"]]}, GeoGridLines -> {{{20, Red}, {30, Orange}, {40, Yellow}, {50, Green}, {60, Blue}}, None}, GeoGridLinesStyle -> #]& /@ {Opacity[1], Automatic}GeoGraphics[Entity["Country", "UnitedStates"], GeoGridLines -> Quantity[5, "AngularDegrees"]]GeoGraphics[Entity["Country", "UnitedStates"], GeoGridLines -> Quantity[500, "Kilometer"]]某些地理函数的整数参数和选项设置被解释为以米为单位的距离(或者半径):
With[{city = Entity["City", {"Rugby", "NorthDakota", "UnitedStates"}]}, GeoGraphics[{GeoDisk[city, 4.4*^6], Red, PointSize[Large], Point[city]}, GeoRange -> 4.5*^6, GeoGridLines -> Automatic]]但是,一个整数地理网格线规范意味着显示的是一个“良好”的网格线的近似数目:
GeoGraphics[Entity["City", {"Rugby", "NorthDakota", "UnitedStates"}], GeoGridLines -> 5, GeoGridLinesStyle -> Pink]使用 GeoPath 交互式显示地理线的地理坐标:
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"]巧妙范例 (3)
GeoGraphics[GeoRange -> "World", GeoGridLines -> {Table[{RandomReal[{-90, 90}], Hue[RandomReal[]]}, {30}], Table[{RandomReal[{-180, 180}], Hue[RandomReal[]]}, {30}]}]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"]]
]
]Length[large = CityData[{Large, "UnitedStates"}]]largest = TakeLargest[EntityValue[large, "Population", "EntityAssociation"], 25]pos = CityData[#, "Coordinates"]& /@ Keys[largest];
points = Tooltip[Point[#1], #2]&@@@Transpose[{GeoPosition /@ pos, Keys@largest}];GeoGraphics[{Polygon[Entity["Country", "UnitedStates"]], PointSize[Medium], points}, GeoGridLines -> Transpose[pos], GeoBackground -> "ReliefMap"]技术笔记
相关指南
-
▪
- 地图和制图
文本
Wolfram Research (2014),GeoGridLines,Wolfram 语言函数,https://reference.wolfram.com/language/ref/GeoGridLines.html.
CMS
Wolfram 语言. 2014. "GeoGridLines." Wolfram 语言与系统参考资料中心. Wolfram Research. https://reference.wolfram.com/language/ref/GeoGridLines.html.
APA
Wolfram 语言. (2014). GeoGridLines. Wolfram 语言与系统参考资料中心. 追溯自 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: 17-November-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: 17-November-2026]}