1 gma 簡介
gma 是一個基于 Python 的地理、氣象數(shù)據(jù)快速處理和數(shù)據(jù)分析函數(shù)包(Geographic and Meteorological Analysis,gma)。gma 網(wǎng)站:地理與氣象分析庫。
gma 的主要功能有哪些?
氣候氣象(例如 SPEI、SPI、ET0 等)。
遙感指數(shù)(例如 NDVI、EVI、TVDI 等)。
數(shù)學(xué)運算(例如 數(shù)據(jù)平滑、評估、濾波、拉伸、增強變換等)。
系統(tǒng)交互(例如 獲取路徑、重命名、壓縮等操作)。
空間雜項(例如 計算空間距離、面積計算,坐標(biāo)轉(zhuǎn)換、空間插值等操作)。
柵格處理(例如 柵格鑲嵌、裁剪、重采樣、重投影、格式轉(zhuǎn)換、數(shù)據(jù)融合等)。
柵格分析(例如 DEM 坡度、坡向、陰影、等值線等計算)。
矢量處理(例如 矢量裁剪、擦除、交集、融合、重投影等)。
地圖工具(例如 柵格、矢量數(shù)據(jù)繪圖,指北針、比例尺等生成,坐標(biāo)系定義等)
本文所用的 gma 版本及下載
目前,本文所用的 gma 版本 為 gma-1.1.5a15。
系統(tǒng) (X64): Window 10+
Python 版本: 3.10.9
下載地址:
鏈接:https://pan.baidu.com/s/12wyfOGo0IMsIQIca7iOrxg?pwd=9scj
提取碼:9scj
其他版本可使用 pip install gma
安裝
2 發(fā)展歷程
gma 繪圖功能以 ArcGIS 繪圖功能為參考,目標(biāo)是構(gòu)建一個以 Python 為基礎(chǔ)的快速地理繪圖工具。
其大約與2022 年 11 月 疫情居家期間開始構(gòu)建,目前開放(指的是可以直接調(diào)用,且有使用幫助的)功能包括:
- plot:主要功能是創(chuàng)建地圖框。
- rcs: 為配合繪圖功能,構(gòu)建的擴展空間參考模塊。目的在于初始化已有坐標(biāo)系,并創(chuàng)建自定義坐標(biāo)系。
- inres:內(nèi)置資源模塊,主要提供 gma 內(nèi)置的一些矢量數(shù)據(jù)、柵格數(shù)據(jù),方便底圖添加。
從 1.1.2 版本開始,gma 繪圖功能的主要更新說明如下:
- 1.1.2:新增 map 地圖工具包,開始支持空間繪圖(基于 gma 的 矢量圖層(Layer)和柵格數(shù)據(jù)集類(DataSet))。
- 1.1.3:添加?xùn)鸥駭?shù)據(jù)集繪制功能(離散型柵格)等。
- 1.1.4:添加?xùn)鸥駭?shù)據(jù)集繪制功能(重分類或唯一值柵格)等,開始內(nèi)置一些底圖數(shù)據(jù)(世界國家、世界陸地和海洋DEM)。
- 1.1.5(將在2023年4月的某個周末發(fā)布):添加矢量要素(Feature)繪制功能,添加更多的地圖數(shù)據(jù)(湖泊、陸地、河流、海洋以及自然地球影像)。
其中也伴隨著眾多 BUG 修復(fù)和功能優(yōu)化,以及一些配套函數(shù)的構(gòu)建,例如(以下函數(shù)均位于gma.io 模塊下):
CreateFeatureFromPoints:根據(jù)坐標(biāo)點創(chuàng)建 Feature(然后可按照矢量要素的方法添加)
CreateLayerFromFeature:將多個Feature 合并生成 Layer(然后可按照矢量圖層方法添加)
ReadArrayAsDataSet:將數(shù)組讀取為 DataSet(然后可按照柵格數(shù)據(jù)集的方式添加)
TranslateFeatureToDataSet:將矢量要素轉(zhuǎn)換為柵格數(shù)據(jù)集(類似于矢量轉(zhuǎn)柵格)
TranslateLayerToDataSet:將矢量圖層轉(zhuǎn)換為柵格數(shù)據(jù)集(類似于矢量轉(zhuǎn)柵格)
3 主要繪圖思路與步驟
- 第一步:添加一個地圖框。與 ArcGIS 地圖框類似,后續(xù)所有數(shù)據(jù)均在地圖框內(nèi)添加和繪制。
- 第二步:添加數(shù)據(jù)(包括 矢量圖層、矢量要素、柵格數(shù)據(jù)集等)、并配置參數(shù)(顏色、大小、寬度等)。與ArcGIS 類似,這些數(shù)據(jù)在添加到地圖框后均會被重投影到地圖框配置的底圖坐標(biāo)系上;可配置的參數(shù)類似ArcGIS的符號系統(tǒng),例如矢量數(shù)據(jù)的背景色、邊界色等,柵格數(shù)據(jù)的色帶(顏色條)、拉伸方式(例如直方圖均衡化)和數(shù)據(jù)變換(例如 gamma 變換)等。
- 第三步:添加地圖整飾要素(例如:指北針、比例尺和圖例等)。與 ArcGIS 的地圖整飾要素類似,可通過參數(shù)控制顏色、大小、樣式等。
4 主要繪圖功能示例 (gma 1.1.5 +)
from gma.map import rcs, plot, inres
4.1 繪制包含國界線的自然地球圖
# 1.初始化一個地圖框,底圖為 WGS84 坐標(biāo)系
MapF = plot.MapFrame(Axes = None, BaseMapProj = 'WGS84', Extent = None)
# 2.將內(nèi)置的世界矢量圖層添加到地圖框
# 2.1 添加內(nèi)置國界(矢量數(shù)據(jù)),并設(shè)置填充色透明,線寬 0.2,線黑色
MapL1 = MapF.AddLayer(inres.WorldLayer.Country, FaceColor = 'none', LineWidth = 0.2, EdgeColor = 'black', Zorder = 1)
# 2.2 添加自然地球底圖(RGB 柵格,不需要配置色帶)
MapD1 = MapF.AddDataSetDiscrete(inres.WorldDataSet.NaturalEarth)
# 3.獲取經(jīng)緯網(wǎng),但不顯示經(jīng)緯網(wǎng),為地圖框刻度使用
GridLines = MapF.AddGridLines(LineColor = 'none')
# 4. 設(shè)置地圖框邊框
Frame = MapF.SetFrame()
4.2 繪制陸地、海洋、河流和湖泊數(shù)據(jù)
# 1.初始化一個地圖框,底圖為 WGS84 坐標(biāo)系
MapF = plot.MapFrame(Axes = None, BaseMapProj = 'WGS84', Extent = None)
# 2.將內(nèi)置的世界矢量圖層添加到地圖框
MapL1 = MapF.AddLayer(inres.WorldLayer.Land, FaceColor = 'white', LineWidth = 0.2, EdgeColor = 'black')
MapL2 = MapF.AddLayer(inres.WorldLayer.Lake, FaceColor = 'lightblue', LineWidth = 0.2, EdgeColor = '#BEE8FF', Zorder = 2)
MapL3 = MapF.AddLayer(inres.WorldLayer.River, LineColor = 'lightblue', LineWidth = 0.2, Zorder = 3)
MapL4 = MapF.AddLayer(inres.WorldLayer.Ocean, FaceColor = '#BEE8FF', EdgeColor = 'none')
# 3.獲取經(jīng)緯網(wǎng),但不顯示經(jīng)緯網(wǎng),為地圖框刻度使用
GridLines = MapF.AddGridLines(LineColor = 'none')
# 4. 設(shè)置地圖框邊框
Frame = MapF.SetFrame()
4.3 最好把中國放在地圖中央
# 0 使用 gma 定義一個中心經(jīng)線為 150°E 的簡易圓柱投影(即:改變了中央經(jīng)線的地理坐標(biāo)系)
Proj = rcs.CustomGCS(CentralLongitude = 150)
# 1.初始化一個地圖框,底圖 0 定義的坐標(biāo)系
MapF = plot.MapFrame(Axes = None, BaseMapProj = Proj, Extent = None)
# 2.將內(nèi)置的世界矢量圖層添加到地圖框
MapL1 = MapF.AddLayer(inres.WorldLayer.Land, FaceColor = 'white', LineWidth = 0.2, EdgeColor = 'black')
MapL2 = MapF.AddLayer(inres.WorldLayer.Lake, FaceColor = 'lightblue', LineWidth = 0.2, EdgeColor = '#BEE8FF', Zorder = 2)
MapL3 = MapF.AddLayer(inres.WorldLayer.River, LineColor = 'lightblue', LineWidth = 0.2, Zorder = 3)
MapL4 = MapF.AddLayer(inres.WorldLayer.Ocean, FaceColor = '#BEE8FF', EdgeColor = 'none')
# 3.獲取經(jīng)緯網(wǎng),但不顯示經(jīng)緯網(wǎng),為地圖框刻度使用
GridLines = MapF.AddGridLines(LineColor = 'none')
# 4. 設(shè)置地圖框邊框
Frame = MapF.SetFrame()
4.4 為添加的柵格數(shù)據(jù)集進行拉伸和變換(數(shù)據(jù)增強)
4.4.1 拉伸數(shù)據(jù)集(以百分比截斷拉伸為例)
# 0 使用 gma 定義一個中心經(jīng)線為 150°E 的簡易圓柱投影(即:改變了中央經(jīng)線的地理坐標(biāo)系)
Proj = rcs.CustomGCS(CentralLongitude = 150)
# 1.初始化一個地圖框,底圖 0 定義的坐標(biāo)系
MapF = plot.MapFrame(Axes = None, BaseMapProj = Proj, Extent = None)
# 2.將內(nèi)置的世界矢量圖層添加到地圖框
# 2.1 添加內(nèi)置國界(矢量數(shù)據(jù)),并設(shè)置填充色透明,線寬 0.2,線黑色
MapL1 = MapF.AddLayer(inres.WorldLayer.Country, FaceColor = 'none', LineWidth = 0.2, EdgeColor = 'black', Zorder = 1)
# 2.2 添加自然地球底圖,并對數(shù)據(jù)進行百分比截斷拉伸(相關(guān)參數(shù)詳見:gma.math.Stretch)
MapD1 = MapF.AddDataSetDiscrete(inres.WorldDataSet.NaturalEarth, Stretch = 'Percentage')
# 3.獲取經(jīng)緯網(wǎng),但不顯示經(jīng)緯網(wǎng),為地圖框刻度使用
GridLines = MapF.AddGridLines(LineColor = 'none')
# 4. 添加地圖框邊框
Frame = MapF.SetFrame()
4.4.2 變換數(shù)據(jù)集(以 Gamma 變換為例)
# 0 使用 gma 定義一個中心經(jīng)線為 150°E 的簡易圓柱投影(即:改變了中央經(jīng)線的地理坐標(biāo)系)
Proj = rcs.CustomGCS(CentralLongitude = 150)
# 1.初始化一個地圖框,底圖 0 定義的坐標(biāo)系
MapF = plot.MapFrame(Axes = None, BaseMapProj = Proj, Extent = None)
# 2.將內(nèi)置的世界矢量圖層添加到地圖框
# 2.1 添加內(nèi)置國界(矢量數(shù)據(jù)),并設(shè)置填充色透明,線寬 0.2,線黑色
MapL1 = MapF.AddLayer(inres.WorldLayer.Country, FaceColor = 'none', LineWidth = 0.2, EdgeColor = 'black', Zorder = 1)
# 2.2 添加自然地球底圖,并對數(shù)據(jù)進行 gamma 變換,并設(shè)置變換值(相關(guān)參數(shù)詳見:gma.math.Correction)
MapD1 = MapF.AddDataSetDiscrete(inres.WorldDataSet.NaturalEarth, Correction = 'Gamma', CorrectionPROP = dict(GammaV = 2))
# 3.獲取經(jīng)緯網(wǎng),但不顯示經(jīng)緯網(wǎng),為地圖框刻度使用
GridLines = MapF.AddGridLines(LineColor = 'none')
# 4. 添加地圖框邊框
Frame = MapF.SetFrame()
4.5 繪制單波段數(shù)據(jù)集,并為其配置色帶
# 0 使用 gma 定義一個中心經(jīng)線為 150°E 的簡易圓柱投影(即:改變了中央經(jīng)線的地理坐標(biāo)系)
Proj = rcs.CustomGCS(CentralLongitude = 150)
# 1.初始化一個地圖框,底圖 0 定義的坐標(biāo)系
MapF = plot.MapFrame(Axes = None, BaseMapProj = Proj, Extent = None)
# 2.將內(nèi)置的世界矢量圖層添加到地圖框
# 2.1 添加內(nèi)置國界(矢量數(shù)據(jù)),并設(shè)置填充色透明,線寬 0.2,線黑色
MapL1 = MapF.AddLayer(inres.WorldLayer.Country, FaceColor = 'none', LineWidth = 0.2, EdgeColor = 'black', Zorder = 1)
# 2.2 添加世界陸地和海洋 DEM ,并配置 jet 色帶
MapD1 = MapF.AddDataSetDiscrete(inres.WorldDataSet.DEM, CMap = 'jet')
# 3.獲取經(jīng)緯網(wǎng),但不顯示經(jīng)緯網(wǎng),為地圖框刻度使用
GridLines = MapF.AddGridLines(LineColor = 'none')
# 4. 添加地圖框邊框
Frame = MapF.SetFrame()
4.6 在地圖上繪制點、線、面
Points = [[112.5, 34.4], [30, 60], [2.3, 48.8], [47.5, -18.9]]
# 創(chuàng)建點、線、面 Feature
FPoints = plot.CreatePlotFeature(Points, Type = 'MultiPoint')
FLine = plot.CreatePlotFeature(Points, Type = 'Line')
FPolygon = plot.CreatePlotFeature(Points, Type = 'Polygon')
# 1.初始化一個地圖框
MapF = plot.MapFrame(Axes = None, BaseMapProj = Proj, Extent = None)
# 2.將內(nèi)置的世界矢量圖層添加到地圖框
MapD1 = MapF.AddDataSetDiscrete(inres.WorldDataSet.NaturalEarth, Zorder = 0)
# 2.2 添加面、線、點
MapL1 = MapF.AddFeature(FPolygon, FaceColor = (0.8, 0.5, 0.5, 0.5), Zorder = 1)
MapL2 = MapF.AddFeature(FLine, LineColor = 'green', LineWidth = 0.5, Zorder = 2)
MapL3 = MapF.AddFeature(FPoints, PointColor = 'red', PointSize = 2, Zorder = 3)
MapF.AddGridLines(LineColor = 'none')
Frame = MapF.SetFrame()
4.7 換個視角看一下
Points = [[112.5, 34.4], [30, 60], [2.3, 48.8], [47.5, -18.9]]
# 創(chuàng)建點、線、面 Feature
FPoints = plot.CreatePlotFeature(Points, Type = 'MultiPoint')
FLine = plot.CreatePlotFeature(Points, Type = 'Line')
FPolygon = plot.CreatePlotFeature(Points, Type = 'Polygon')
# 0 使用 gma 定義一個中心經(jīng)線為 112°E 的 Albers 等面積投影
Proj = rcs.AlbersEqualArea(CentralLongitude = 112)
# 1.初始化一個地圖框,底圖 0 定義的坐標(biāo)系
MapF = plot.MapFrame(Axes = None, BaseMapProj = Proj, Extent = None)
# 2.將內(nèi)置的世界矢量圖層添加到地圖框
MapD1 = MapF.AddDataSetDiscrete(inres.WorldDataSet.NaturalEarth, Zorder = 0)
# 2.2 添加面、線、點
MapL1 = MapF.AddFeature(FPolygon, FaceColor = (0.8, 0.5, 0.5, 0.5), Zorder = 1)
MapL2 = MapF.AddFeature(FLine, LineColor = 'green', LineWidth = 0.5, Zorder = 2)
MapL3 = MapF.AddFeature(FPoints, PointColor = 'red', PointSize = 2, Zorder = 3)
MapF.AddGridLines(LineColor = 'none')
Frame = MapF.SetFrame()
5 從空間插值到地圖繪制全過程
5.1 從反距離權(quán)重插值到繪圖
示例數(shù)據(jù)下載:
鏈接:https://pan.baidu.com/s/1-lNWdo-V5bsa1r5JS_N4wg?pwd=agzp
提取碼:agzp
5.1.1 讀取數(shù)據(jù)并插值
# import gma
import pandas as pd
from gma import io
from gma.smc import Interpolate
from gma.map import rcs, plot, inres
Data = pd.read_excel("Interpolate.xlsx")
Points = Data.loc[:, ['經(jīng)度','緯度']].values
Values = Data.loc[:, ['值']].values
# 步驟1:反距離權(quán)重插值
IDWD = Interpolate.IDW(Points, Values, Resolution = 0.01, InProjection = 'WGS84')
# 步驟2:將插值結(jié)果轉(zhuǎn)換為 DataSet 數(shù)據(jù)集
IDWDataSet = io.ReadArrayAsDataSet(IDWD.Data, Projection = 'WGS84', Transform = IDWD.Transform)
5.1.2 繪圖(離散型)
# 步驟3:繪圖
# 0 使用 gma 定義一個中心經(jīng)線為 125°E ,兩條標(biāo)準(zhǔn)緯線為 40°N, 52°N 的 Albers 等面積投影
Proj = rcs.AlbersEqualArea(CentralLongitude = 125, StandardParallels = (40, 52))
# 1.初始化一個地圖框,并配置視圖范圍
MapF = plot.MapFrame(Axes = None, BaseMapProj = Proj, Extent = [112, 38, 138, 54])
# 2.將內(nèi)置的世界矢量圖層添加到地圖框
MapL1 = MapF.AddLayer(inres.WorldLayer.Country, FaceColor = 'none', LineWidth = 0.2, EdgeColor = 'black', Zorder = 2)
MapL2 = MapF.AddLayer(inres.WorldLayer.Ocean, FaceColor = '#BEE8FF', EdgeColor = 'none')
MapD1 = MapF.AddDataSetDiscrete(IDWDataSet, CMap = 'jet', Zorder = 1)
# 3.獲取經(jīng)緯網(wǎng)
GridLines = MapF.AddGridLines(LONRange = (100, 150, 5), LATRange = (30, 60, 5))
# 4.設(shè)置地圖框邊框
Frame = MapF.SetFrame()
5.1.3 地圖整飾要素(指北針、比例尺)修飾
# 0 使用 gma 定義一個中心經(jīng)線為 125°E ,兩條標(biāo)準(zhǔn)緯線為 40°N, 52°N 的 Albers 等面積投影
Proj = rcs.AlbersEqualArea(CentralLongitude = 125, StandardParallels = (40, 52))
# 1.初始化一個地圖框,并配置視圖范圍
MapF = plot.MapFrame(Axes = None, BaseMapProj = Proj, Extent = [112, 38, 138, 54])
# 2.將內(nèi)置的世界矢量圖層添加到地圖框
MapL1 = MapF.AddLayer(inres.WorldLayer.Country, FaceColor = 'none', LineWidth = 0.2, EdgeColor = 'black', Zorder = 2)
MapL2 = MapF.AddLayer(inres.WorldLayer.Ocean, FaceColor = '#BEE8FF', EdgeColor = 'none')
MapD1 = MapF.AddDataSetDiscrete(IDWDataSet, CMap = 'jet', Zorder = 1)
# 3.獲取經(jīng)緯網(wǎng)
GridLines = MapF.AddGridLines(LONRange = (100, 150, 5), LATRange = (30, 60, 5))
# 4.添加地圖整飾要素
AddCompass = MapF.AddCompass(LOC = (0.1, 0.8), Color = 'black')
ScaleBar = MapF.AddScaleBar(LOC = (0.1, 0.02), Width = 0.3, Color = 'black', FontSize = 7)
# 5.設(shè)置地圖框邊框
Frame = MapF.SetFrame()
5.1.4 繪制重分類圖并添加圖例
# 0 使用 gma 定義一個中心經(jīng)線為 125°E ,兩條標(biāo)準(zhǔn)緯線為 40°N, 52°N 的 Albers 等面積投影
Proj = rcs.AlbersEqualArea(CentralLongitude = 125, StandardParallels = (40, 52))
# 1.初始化一個地圖框,并配置視圖范圍
MapF = plot.MapFrame(Axes = None, BaseMapProj = Proj, Extent = [112, 38, 138, 54])
# 2.將內(nèi)置的世界矢量圖層添加到地圖框
MapL1 = MapF.AddLayer(inres.WorldLayer.Country, FaceColor = 'none', LineWidth = 0.2, EdgeColor = 'black', Zorder = 2)
MapL2 = MapF.AddLayer(inres.WorldLayer.Ocean, FaceColor = '#BEE8FF', EdgeColor = 'none')
MapD1 = MapF.AddDataSetClassify(IDWDataSet,
CMap = 'jet',
Remap = [[-25, 0], [-20, 1], [-15, 2], [-10, 3],[-5, 4], [100, 5]],
Method = 'Range',
Labels = ['<= -25', '-25 ~ -20', '-20 ~ -15','-15 ~ -10','-10 ~ -5',' > -5'],
Zorder = 1
)
# 3.獲取經(jīng)緯網(wǎng)
GridLines = MapF.AddGridLines(LONRange = (100, 150, 5), LATRange = (30, 60, 5))
# 4.添加地圖整飾要素
AddCompass = MapF.AddCompass(LOC = (0.1, 0.8), Color = 'black')
ScaleBar = MapF.AddScaleBar(LOC = (0.1, 0.02), Width = 0.3, Color = 'black', FontSize = 7)
Legend = MapF.AddLegend(LegendName = '氣溫(℃)', TitleAlignment = 'left', PlotID = [2], LOC = (0.75, 0.5), TitleFont = 'SimSun')
# 5.設(shè)置地圖框邊框
Frame = MapF.SetFrame()
5.2 其他插值方法(自然鄰域法、克里金法、趨勢面法、B-樣條函數(shù)法)對比
import matplotlib.pyplot as plt
TD = Interpolate.Trend(Points, Values, Resolution = 0.1)
KD = Interpolate.Kriging(Points, Values, Resolution = 0.1)
NND = Interpolate.NaturalNeighbor(Points, Values, Resolution = 0.1)
BSD = Interpolate.BSpline(Points, Values, Resolution = 0.1)
TDDataSet = io.ReadArrayAsDataSet(TD.Data, Projection = 'WGS84', Transform = TD.Transform)
KDDataSet = io.ReadArrayAsDataSet(KD.Data, Projection = 'WGS84', Transform = KD.Transform)
NNDDataSet = io.ReadArrayAsDataSet(NND.Data, Projection = 'WGS84', Transform = NND.Transform)
BSDDataSet = io.ReadArrayAsDataSet(BSD.Data, Projection = 'WGS84', Transform = BSD.Transform)
# 0 使用 gma 定義一個中心經(jīng)線為 125°E ,兩條標(biāo)準(zhǔn)緯線為 40°N, 52°N 的 Albers 等面積投影
Proj = rcs.AlbersEqualArea(CentralLongitude = 125, StandardParallels = (40, 52))
PlotDS = [TDDataSet, KDDataSet, NNDDataSet, BSDDataSet]
Titles = ['Trend', 'Kriging', 'NaturalNeighbor', 'BSpline']
fig = plt.figure(figsize = (8, 6), dpi = 300)
for i in range(4):
Axes = plt.subplot(2, 2, i + 1)
# 1.初始化一個地圖框,并配置視圖范圍
MapF = plot.MapFrame(Axes = Axes, BaseMapProj = Proj, Extent = [110, 38, 140, 54])
# 2.將內(nèi)置的世界矢量圖層添加到地圖框
MapL1 = MapF.AddLayer(inres.WorldLayer.Country, FaceColor = 'none', LineWidth = 0.2, EdgeColor = 'black', Zorder = 2)
MapL2 = MapF.AddLayer(inres.WorldLayer.Ocean, FaceColor = '#BEE8FF', EdgeColor = 'none')
MapD1 = MapF.AddDataSetClassify(PlotDS[i],
CMap = 'jet',
Remap = [[-25, 0], [-20, 1], [-15, 2], [-10, 3],[-5, 4], [100, 5]],
Method = 'Range',
Labels = ['<= -25', '-25 ~ -20', '-20 ~ -15','-15 ~ -10','-10 ~ -5',' > -5'],
Zorder = 1
)
# 3.獲取經(jīng)緯網(wǎng)
GridLines = MapF.AddGridLines(LONRange = (100, 150, 5), LATRange = (30, 60, 5))
# 4.添加地圖整飾要素
AddCompass = MapF.AddCompass(LOC = (0.1, 0.75), Color = 'black')
ScaleBar = MapF.AddScaleBar(LOC = (0.1, 0.02), Width = 0.3, Color = 'black', FontSize = 7)
if i == 3:
Legend = MapF.AddLegend(LegendName = '氣溫(℃)',
TitleAlignment = 'left',
LabelFontSize = 5,
PlotID = [2],
LOC = (0.74, 0.35),
HandleLength = 2.3,
HandleHeight = 1.5,
TitleFontSize = 7,
TitleFont = 'SimSun')
Frame = MapF.SetFrame()
Axes.set_title(Titles[i], fontsize = 8, y = 0.85, fontdict = {'family':'Times New Roman'})
fig.subplots_adjust(wspace = 0.02, hspace = 0.01)
6 其他相關(guān)拓展
6.1 查看當(dāng)前系統(tǒng)所有色帶
DefinedCMaps = plot.GetPreDefinedCMaps(PlotCMap = True)
(部分圖)文章來源:http://www.zghlxwxcb.cn/news/detail-407742.html
6.2 查看當(dāng)前系統(tǒng)所有字體
SystemFonts = plot.GetSystemFonts(ShowFonts = True)
(部分圖)文章來源地址http://www.zghlxwxcb.cn/news/detail-407742.html
到了這里,關(guān)于基于 Python 的地理空間繪圖指南(以 gma 空間繪圖功能為例)的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!