Matplotlib 如何使用GeoView缩放正交投影?
我知道,使用matplotlib,我可以通过以下方式放大正交投影:Matplotlib 如何使用GeoView缩放正交投影?,matplotlib,cartopy,orthographic,hvplot,geoviews,Matplotlib,Cartopy,Orthographic,Hvplot,Geoviews,我知道,使用matplotlib,我可以通过以下方式放大正交投影: import cartopy.crs as ccrs import matplotlib.pyplot as plt fig = plt.figure() ax = fig.add_subplot(1, 1, 1, projection=ccrs.Orthographic(-40, 20) ax.set_extent([-110, 30, -20, 65]) 如何使用hvplot/Geoviews/Holoviews执行此操
import cartopy.crs as ccrs
import matplotlib.pyplot as plt
fig = plt.figure()
ax = fig.add_subplot(1, 1, 1, projection=ccrs.Orthographic(-40, 20)
ax.set_extent([-110, 30, -20, 65])
如何使用hvplot/Geoviews/Holoviews执行此操作?我发现的所有例子都没有放大这个特定的投影
实例:
import xarray as xr
import hvplot.pandas
import holoviews as hv
import geoviews.feature as gf
import cartopy.crs as ccrs
proj = ccrs.Orthographic(-40, 20)
lon_range = (-110, 30)
lat_range = (-20, 65)
ds = xr.open_mfdataset(liste_files, engine="netcdf4")
pd_times = ds.to_dataframe() # <-- i cannot plot points with xarray directly, don't know why
points = pd_times.hvplot.points(x="longitude", y="latitude", c="sat1", projection=proj)
points = hv.Overlay(aff)
layout = (gf.ocean
* points
* gf.land.options(scale="50m")
* gf.coastline.options(scale="50m")
* gf.rivers
* gf.lakes
).opts(
width=500,
projection=proj
)
将xarray作为xr导入
导入hvplot.pandas
将全息视图导入为hv
将geoviews.feature导入为gf
将cartopy.crs作为CCR导入
项目=ccrs.正交(-40,20)
lon_范围=(-110,30)
横向范围=(-20,65)
ds=xr.open_mfdataset(liste_文件,engine=“netcdf4”)
pd_times=ds.to_dataframe()#已建立:需要在hvplot的参数中添加xlim
和/或ylim
points = pd_times.hvplot.points(x="longitude", y="latitude", c="sat1", projection=proj, xlim=lon_range, ylim=lat_range)