Python Bokeh patch()将顶点连接到沙漏而不是多边形

Python Bokeh patch()将顶点连接到沙漏而不是多边形,python,plot,bokeh,geopandas,Python,Plot,Bokeh,Geopandas,我试图在世界地图上绘制一个补丁,但不知道如何告诉Bokeh将其绘制为熊猫数据框中的多边形。它似乎以错误的顺序连接顶点,但我不知道如何修复它。我尝试以不同的方式对x和y柱进行排序,因此点将以不同的顺序进行处理,并从pandas格式更改为geopandas格式,并以某种方式应用external.coords.xy,但它要么不起作用,要么什么都没有改变 import pandas as pd import geopandas as gpd import numpy as np

我试图在世界地图上绘制一个补丁,但不知道如何告诉Bokeh将其绘制为熊猫数据框中的多边形。它似乎以错误的顺序连接顶点,但我不知道如何修复它。我尝试以不同的方式对x和y柱进行排序,因此点将以不同的顺序进行处理,并从pandas格式更改为geopandas格式,并以某种方式应用
external.coords.xy
,但它要么不起作用,要么什么都没有改变

    import pandas as pd
    import geopandas as gpd
    import numpy as np
    from bokeh.models import *
    from bokeh.plotting import *
    from bokeh.io import *
    from bokeh.tile_providers import *
    from bokeh.palettes import *
    from bokeh.transform import *
    from bokeh.layouts import *
    
    #My Data
    patchDf = pd.DataFrame([[1,53,5],[2,53,4.5],[3,53.6,5],[4,53.8,4.5]],columns=['Nr','Lat','Lon'])
    patchGdf = gpd.GeoDataFrame(geometry=gpd.points_from_xy(patchDf.Lon, patchDf.Lat))
    
    def wgs84_to_web_mercator(df, lon, lat):
        """Converts decimal longitude/latitude to Web Mercator format"""
        k = 6378137
        df["x"] = df[lon] * (k * np.pi/180.0)
        df["y"] = np.log(np.tan((90 + df[lat]) * np.pi/360.0)) * k
        return df

    #Helper function for data conversion
    df=wgs84_to_web_mercator(myDf,'Lon','Lat')
    patchDf=wgs84_to_web_mercator(patchDf,'Lon','Lat')
    
    #Creating the actual figure
    scale=1000
    x=patchDf['x']
    y=patchDf['y']
    
    x_min=int(x.mean() - (scale * 350))
    x_max=int(x.mean() + (scale * 350))
    y_min=int(y.mean() - (scale * 350))
    y_max=int(y.mean() + (scale * 350))
    
    tile_provider=get_provider(OSM)
    
    plot=figure(title='NL Test Map', match_aspect=True, tools='wheel_zoom,pan,reset,save',
        x_range=(x_min, x_max), y_range=(y_min, y_max), x_axis_type='mercator',
        y_axis_type='mercator')
    
    plot.grid.visible=True
    
    map=plot.add_tile(tile_provider)
    map.level='underlay'
    
    plot.xaxis.visible = False
    plot.yaxis.visible=False
    
    output_notebook()
正在尝试绘制:

    patchDf = patchDf.sort_values(["x","y"],ascending=['True','False'])
    patchCDS = ColumnDataSource(patchDf)
    plot.circle(x='x',y='y', source=patchCDS, line_color='grey', fill_color='yellow')
    plot.patch('x','y', source=patchCDS, fill_color='red',alpha=.8)
    
    show(plot)
它可以很好地绘制圆,并且具有正确的面片顶点,但不会将它们连接到填充多边形,而是连接一个沙漏/两个三角形作为对角线。我怎样才能解决这个问题