python basemap 画出经纬度并标定的实例
作者:jingxian 时间:2023-08-23 23:26:40
如下所示:
两个函数:Basemap.drawparallels ##纬度
Basemap.drawmeridians ##经度
from mpl_toolkits.basemap import Basemap
import matplotlib.pyplot as plt
import numpy as np
# setup Lambert Conformal basemap.
m = Basemap(width=12000000,height=9000000,projection='lcc',
resolution='c',lat_1=45.,lat_2=55,lat_0=50,lon_0=-107.)
# draw coastlines.
m.drawcoastlines()
# draw a boundary around the map, fill the background.
# this background will end up being the ocean color, since
# the continents will be drawn on top.
m.drawmapboundary(fill_color='aqua')
# fill continents, set lake color same as ocean color.
m.fillcontinents(color='coral',lake_color='aqua')
# draw parallels and meridians.
# label parallels on right and top
# meridians on bottom and left
parallels = np.arange(0.,81,10.)
# labels = [left,right,top,bottom]
m.drawparallels(parallels,labels=[False,True,True,False])
meridians = np.arange(10.,351.,20.)
m.drawmeridians(meridians,labels=[True,False,False,True])
plt.show()
来源:https://matplotlib.org/basemap/users/graticule.html
标签:python,basemap,经纬度
0
投稿
猜你喜欢
JQuery的Ajax请求实现局部刷新的简单实例
2024-05-02 17:05:17
Vue实现步骤条效果
2024-04-28 10:54:23
Python+Turtle实现绘制可爱的小仓鼠
2022-09-16 20:52:28
Flask模拟实现CSRF攻击的方法
2023-11-18 16:21:39
golang 中strings包的Replace的使用说明
2024-02-09 16:02:04
Pytorch 卷积中的 Input Shape用法
2023-03-27 21:46:35
python3读取excel文件只提取某些行某些列的值方法
2021-10-19 09:20:09
选项卡动态增删的效果(内嵌框架)
2008-05-22 12:59:00
Bresenham图形算法JavaScript版本
2010-01-25 12:09:00
详解ASP.NET Core中间件Middleware
2024-05-09 09:05:15
在SQL Server中处理空值时涉及的三个问题
2009-02-05 15:30:00
Python中如何给字典设置默认值
2023-09-21 00:15:32
Python Pygame实现兔子猎人守护城堡游戏
2021-09-21 11:09:59
MySQL datetime类型与时间、日期格式字符串大小比较的方法
2024-01-25 23:25:24
玩转MySQL中的外键约束之PHP篇
2010-03-18 10:20:00
Python如何读写CSV文件
2023-03-23 08:41:13
Python实现图片指定位置加图片水印(附Pyinstaller打包exe)
2023-08-13 04:27:16
MySQL Workbench下载与使用教程详解
2024-01-13 18:50:26
Python标准库sched模块使用指南
2022-09-20 12:19:06
python中wheel的用法整理
2022-07-03 18:15:47