Open sunu opened 2 years ago
hvplot '0.7.3' Python 3.10.0 bokeh 2.4.2 geoviews 1.9.3
I'm trying to plot a geojson Polygon as paths. But the Bokeh plot doesn't enclose the polygon.
Here's the code to produce the behaviour:
import geopandas as gpd import hvplot.pandas import warnings warnings.filterwarnings('ignore') geojson = { "type": "FeatureCollection", "features": [ { "type": "Feature", "properties": {}, "geometry": { "type": "Polygon", "coordinates": [ [ [ 85.6167984008789, 20.149751564715373 ], [ 85.66426277160645, 20.149751564715373 ], [ 85.66426277160645, 20.166913620901816 ], [ 85.6167984008789, 20.166913620901816 ], [ 85.6167984008789, 20.149751564715373 ], ] ] } } ] } aoi = gpd.GeoDataFrame.from_features(geojson["features"]) geopath = aoi.hvplot.paths(geo=True, line_width=5) geopath
Here's screenshot of the resulting Bokeh plot:
Plotting the same Polygon with matplotlib results in a bounded box:
The same polygon also renders fine when geo=False:
geo=False
Let me know if I can provide any more info or if I'm doing something wrong while plotting.
This is certainly an odd behavior, but I am wondering if as a workaround you might use:
aoi.hvplot.polygons(geo=True, line_width=5, fill_color=None)
ALL software version info
hvplot '0.7.3' Python 3.10.0 bokeh 2.4.2 geoviews 1.9.3
Description of expected behavior and the observed behavior
I'm trying to plot a geojson Polygon as paths. But the Bokeh plot doesn't enclose the polygon.
Complete, minimal, self-contained example code that reproduces the issue
Here's the code to produce the behaviour:
Screenshots or screencasts of the bug in action
Here's screenshot of the resulting Bokeh plot:
Plotting the same Polygon with matplotlib results in a bounded box:
The same polygon also renders fine when
geo=False
:Let me know if I can provide any more info or if I'm doing something wrong while plotting.