Skip to main content

A tool to add basemap in matplotlib

Project description

plot_map

安装

pip install -U plot-map

底图加载功能

地图底图加载

只需要用以下代码:

import plot_map
#设定显示范围
bounds = [lon1,lat1,lon2,lat2]  
plot_map.plot_map(plt,bounds,zoom = 12,style = 4)  

参数

参数 描述
bounds 底图的绘图边界,[lon1,lat1,lon2,lat2] (WGS84坐标系) 其中,lon1,lat1是左下角坐标,lon2,lat2是右上角坐标
zoom 底图的放大等级,越大越精细,加载的时间也就越久,一般单个城市大小的范围,这个参数选取12到16之间
style 地图底图的样式,可选1-5,或'light','dark',style为4时为light,style为5时为dark
imgsavepath 瓦片地图储存路径,设置路径后,会把地图下载到本地的文件夹下,使用时也会优先搜索是否有已经下载的瓦片,默认的存放路径是C:\
printlog 是否显示日志

绘制指北针和比例尺的功能plotscale

为底图添加指北针和比例尺

plot_map.plotscale(ax,bounds = bounds,textsize = 10,compasssize = 1,accuracy = 2000,rect = [0.06,0.03])  

参数

参数 描述
bounds 底图的绘图边界,[lon1,lat1,lon2,lat2] (WGS84坐标系) 其中,lon1,lat1是左下角坐标,lon2,lat2是右上角坐标
textsize 标注文字大小
compasssize 标注的指北针大小
accuracy 标注比例尺的长度
unit 'KM','km','M','m' 比例尺的单位
style 1或2,比例尺样式
rect 比例尺在图中的大致位置,如[0.9,0.9]则在右上角

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

plot_map-0.3.4.tar.gz (4.8 MB view details)

Uploaded Source

Built Distribution

plot_map-0.3.4-py3-none-any.whl (6.9 kB view details)

Uploaded Python 3

File details

Details for the file plot_map-0.3.4.tar.gz.

File metadata

  • Download URL: plot_map-0.3.4.tar.gz
  • Upload date:
  • Size: 4.8 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.8

File hashes

Hashes for plot_map-0.3.4.tar.gz
Algorithm Hash digest
SHA256 0c086c5ee04458ab1d56a1bfe3bf00142524df6c67ff89adbf9bf67255825eb1
MD5 8509e98d845bb480ce06472eeb2bab72
BLAKE2b-256 cefbf9aff8067fc085aae50e65dac38c6dbae24f42f98630e9fc99f6b7f04364

See more details on using hashes here.

Provenance

File details

Details for the file plot_map-0.3.4-py3-none-any.whl.

File metadata

  • Download URL: plot_map-0.3.4-py3-none-any.whl
  • Upload date:
  • Size: 6.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.8

File hashes

Hashes for plot_map-0.3.4-py3-none-any.whl
Algorithm Hash digest
SHA256 46b25bf4a1116af7c525270c0776f5ab683c18b9d74371e263fa9aaea52cecae
MD5 63f56194338ed4fa1e7d95a6e69b63d2
BLAKE2b-256 fb42f4e48733b332ca8396700b1b02ad8aeaaabdd7dc626826d254af96503219

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page