Hi There,
I am generating gv.Points
maps and keep running into truncation issues at the edges with projected data. It is usually very minor, but in some cases cuts enough to be noticeable, and tends to be magnified a little using panel
.
I have not been able to find a way to pad or change limits a little to avoid this.
I have tried using various .opts()
including xlim, ylim, padding, frame_width, frame_height, aspect
and also messed with plot hooks in panel to modify ranges
.
Using ZoomOutTool
with bokeh/panel achieves the effect, but only with a manual zoom out, which I could not make automatic.
A basic example with the Molleweide projection (usually cuts a little of edge):
import geoviews as gv
import geoviews.feature as ft
from geoviews import opts
from cartopy import crs
from bokeh.plotting import show
gv.extension('bokeh')
# Problem is minor truncation, but it seems like there should be
# some way to size/pad/limit to avoid entirely
cities = [(-74.0, 40.7, 'NYC'), (116.4, 39.9, 'Beijing'), (-0.13, 51.5, 'London')]
cities_latlon = gv.Points(cities, vdims='City')
molleweide = crs.Mollweide()
# Projected does not seem to use the lim/padding args
cities_latlon.opts(
size=10,
color='blue',
projection=molleweide,
global_extent=True,
width=900,
aspect='equal',
xlim=(-10, 370),
ylim=(-100, 100),
padding=0.1
)
plotit = cities_latlon * ft.coastline
render_plot = gv.render(plotit)
show(render_plot)
# Example in panel - same issue, just a little more so
import panel as pn
options=['jet','Bokeh','TolRainbow_r','Turbo','RdYlBu_r']
cmap_sel = pn.widgets.Select(
options=options, name='Color Map', value='jet', description='Choose a Color Map',
)
bokeh_server = pn.Row(cmap_sel, plotit).show(port=12345)
So if there are options to avoid or reduce the change of these little truncations whether that be in geoviews, panel, or the projection / data itself, I am interested to know about them.
I am using:
holviews 1.18.3, geoviews 1.11.1, bokeh 3.3.4, and panel 1.3.8 on ubuntu linux with Brave as the browser.