1, 1, projection=ccrs.PlateCarree())# 用经纬度对地图区域进行截取,这里只展示我国沿海区域ax.set_extent([85,170,-20,60], crs=ccrs.PlateCarree())# 设置名称ax.set_title('2017年台风路径图',fontsize=16)# 设置地图属性,比如加载河流、海洋ax.add_feature(cfeature.LAND)ax.(cfeature.OCEAN)ax....
import seaborn as sns import matplotlib.pyplot as plt import pandas as pd from sklearn.datasets import load_iris # 加载Iris数据集 iris = load_iris() iris_df = pd.DataFrame(data=iris.data, columns=iris.feature_names) iris_df['species'] = iris.target # 将物种名称映射为数值类型 species_...
ax = fig.add_subplot(1, 1, 1, projection=ccrs.PlateCarree()) # 绘制地图背景 ax.add_feature(cartopy.feature.OCEAN) ax.add_feature(cartopy.feature.LAND, edgecolor='black') ax.add_feature(cartopy.feature.COASTLINE) ax.add_feature(cartopy.feature.BORDERS, linestyle=':') # 标记出一些国家 wor...
1,1,projection=ccrs.PlateCarree())# 用经纬度对地图区域进行截取,这里只展示我国沿海区域ax.set_extent([85,170,-20,60],crs=ccrs.PlateCarree())# 设置名称ax.set_title('2017年台风路径图',fontsize=16)# 设置地图属性,比如加载河流、海洋ax.add_feature(cfeature.LAND)ax.add_feature(cfeature.OCEAN)...
axes = fig.add_axes([0, 0, 1, 1], projection=proj) axes.add_feature(cfeature.COASTLINE, zorder=2, linewidth=1.5) axes.add_feature(cfeature.LAND, zorder=1) leftlon, rightlon, lowerlat, upperlat = (117.11,122.46,36.27,42.3)
ax1.add_feature(cfeature.COASTLINE, zorder=1) # 绘制海岸线 cf = ax1.contourf( lon, lat, data, transform=ccrs.PlateCarree(), zorder=0); # 绘制填色图 # 生成Path和进行裁剪所需要的的模块 from matplotlib.path import Path from cartopy.mpl.patch import geos_to_path ...
plt.ylabel(iris.feature_names[1]); 我们可以从上图中看出,可以通过散点图同时展示该数据集的四个不同维度:图中的(x, y)位置代表每个样本的花萼的长度和宽度,散点的大小代表每个样本的花瓣的宽度,而散点的颜色代表一种特定的鸢尾花类型。如上图的多种...
importmatplotlib.pyplotaspltimportcartopy.crsasccrsimportcartopy.featureascfeature# 创建一个地图投影对象proj=ccrs.PlateCarree()# 创建一个地图图像对象ax=plt.axes(projection=proj)# 添加地图边界和海岸线ax.add_feature(cfeature.BORDERS,linestyle='-',alpha=0.5)ax.add_feature(cfeature.COASTLINE,linestyle=...
import cartopy.crs as ccrs from cartopy.mpl.ticker import LatitudeFormatter, LongitudeFormatter proj = ccrs.PlateCarree(central_longitude=180) fig, ax = plt.subplots(1, 1, subplot_kw={'projection': proj}) ax.coastlines() ax.add_feature(cfeature.LAKES, edgecolor='black') ...
ax.add_feature(cities, linewidth=0.7) ax.set_extent(extent, crs=proj)gl = ax.gridlines(crs=ccrs.PlateCarree(), draw_labels=True,linewidth=0.7, color='k', alpha=0.5, linestyle='--') gl.xlabels_top = False gl.ylabels_right = False ...