我知道使用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 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
)谢谢
发布于 2020-09-01 17:47:56
创建:需要在hvplot的参数中添加xlim和/或ylim。
points = pd_times.hvplot.points(x="longitude", y="latitude", c="sat1", projection=proj, xlim=lon_range, ylim=lat_range)https://stackoverflow.com/questions/63666931
复制相似问题