Python e、 y轴位置=无,) p1=图形(匹配\纵横比=真,纵横比=2,x \轴\位置=无,y \轴\位置=无,) p2=图形(匹配\纵横比=真,纵横比=2,x \轴\位置=无,y \轴\位置=无,) p3=图形(匹配\纵横比=真,纵横比=2,x \轴\位置=无

Python e、 y轴位置=无,) p1=图形(匹配\纵横比=真,纵横比=2,x \轴\位置=无,y \轴\位置=无,) p2=图形(匹配\纵横比=真,纵横比=2,x \轴\位置=无,y \轴\位置=无,) p3=图形(匹配\纵横比=真,纵横比=2,x \轴\位置=无,python,gis,bokeh,geojson,patch,Python,Gis,Bokeh,Geojson,Patch,e、 y轴位置=无,) p1=图形(匹配\纵横比=真,纵横比=2,x \轴\位置=无,y \轴\位置=无,) p2=图形(匹配\纵横比=真,纵横比=2,x \轴\位置=无,y \轴\位置=无,) p3=图形(匹配\纵横比=真,纵横比=2,x \轴\位置=无,y \轴\位置=无,) #密谋 p0.title.text=“地图具有“+str(len(xs))+”多边形,使用“+str(len(source1.data['x']))+”面片,不同颜色进行修补” p0.patches('x','y',s

e、 y轴位置=无,) p1=图形(匹配\纵横比=真,纵横比=2,x \轴\位置=无,y \轴\位置=无,) p2=图形(匹配\纵横比=真,纵横比=2,x \轴\位置=无,y \轴\位置=无,) p3=图形(匹配\纵横比=真,纵横比=2,x \轴\位置=无,y \轴\位置=无,) #密谋 p0.title.text=“地图具有“+str(len(xs))+”多边形,使用“+str(len(source1.data['x']))+”面片,不同颜色进行修补” p0.patches('x','y',source=source0, fill_color={'field':'color','transform':LinearColorMapper(palete=palete,low=0,high=len(xs)), 填充字母=0.5,线条颜色=黑色,线条宽度=0.5) p1.title.text=“地图具有“+str(len(xs))+”多边形,使用“+str(len(source1.data['x']))+”面片进行修补,颜色相同” p1.补丁('x','y',源=源1, fill_color={'field':'color','transform':LinearColorMapper(palete=palete,low=0,high=len(xs)), 填充字母=0.5,线条颜色=黑色,线条宽度=0.5) p2.title.text=“地图有“+str(len(xs))+”多边形,使用“+str(len(source2.data['x']))+”使用NaN分隔符进行修补(太暗,错误)” p2.补丁('x','y',源=源2, fill_color={'field':'color','transform':LinearColorMapper(palete=palete,low=0,high=len(xs)), 填充字母=0.5,线条颜色=黑色,线条宽度=0.5) p3.title.text=“地图具有“+str(len(xs))+”多边形,使用“+str(len(source3.data['x']))+”多边形,相同颜色” p3.多重多边形(xs='x',ys='y',源=源3, fill_color={'field':'color','transform':LinearColorMapper(palete=palete,low=0,high=len(xs)), 填充字母=0.5,线条颜色=黑色,线条宽度=0.5) 显示(列(p0、p1、p2、p3,大小调整模式=‘比例宽度’)
Hi man@Dredos,欢迎来到社区。我相信,经过数小时的研究,我找到了解决办法,我会慢慢来,尽快完成你的答案。无论如何,非常感谢你的回答和时间。
import pandas as pd
import numpy as np
import geopandas as gpd
from bokeh.io import (output_notebook, show, curdoc, output_file)
from bokeh.plotting import figure
from bokeh.models import GeoJSONDataSource, LinearColorMapper, ColorBar, ColumnDataSource
from bokeh.models.glyphs import MultiPolygons
from copy import deepcopy
from bokeh.palettes import Pastel2, viridis, inferno, magma, Paired, Spectral, brewer, Greens, YlGn
import matplotlib.pyplot as plt
output_notebook()

geoIrl = gpd.read_file('Census2011_Local_Electoral_Areas_2008.shp')
irlg = geoIrl[['COUNTY','geometry']]
irl = irlg.dissolve(by='COUNTY', aggfunc='sum')
dfirl = deepcopy(irl)


#extracting the xs and ys
def getPolyCoords(row, geom, coord_type):
    """Returns the coordinates ('x|y') of edges/vertices of a Polygon/others"""

    # Parse the geometries and grab the coordinate
    geometry = row[geom]
    #print(geometry.type)

    if geometry.type=='Polygon':
        if coord_type == 'x':
            # Get the x coordinates of the exterior
            # Interior is more complex: xxx.interiors[0].coords.xy[0]
            return list( geometry.exterior.coords.xy[0] )
        elif coord_type == 'y':
            # Get the y coordinates of the exterior
            return list( geometry.exterior.coords.xy[1] )

    if geometry.type in ['Point', 'LineString']:
        if coord_type == 'x':
            return list( geometry.xy[0] )
        elif coord_type == 'y':
            return list( geometry.xy[1] )

    if geometry.type=='MultiLineString':
        all_xy = []
        for ea in geometry:
            if coord_type == 'x':
                all_xy.append(list( ea.xy[0] ))
            elif coord_type == 'y':
                all_xy.append(list( ea.xy[1] ))
        return all_xy

    if geometry.type=='MultiPolygon':
        all_xy = []
        for ea in geometry:
            if coord_type == 'x':
                all_xy.append(list( ea.exterior.coords.xy[0] ))
            elif coord_type == 'y':
                all_xy.append(list( ea.exterior.coords.xy[1] ))
        return all_xy

    else:
        # Finally, return empty list for unknown geometries
        return []

dfirl['xs'] = dfirl.apply(getPolyCoords, geom='geometry', coord_type='x', axis=1)
dfirl['ys'] = dfirl.apply(getPolyCoords, geom='geometry', coord_type='y', axis=1)

rX = 'CARLOW', 'CAVAN', 'CLARE', 'CORK', 'DONEGAL', 'DUBLIN', 'GALWAY','KERRY', 'KILDARE', 'KILKENNY', 'LAOIS', 'LEITRIM', 'LIMERICK','LONGFORD', 'LOUTH', 'MAYO', 'MEATH', 'MONAGHAN', 'OFFALY', 'ROSCOMMON', 'SLIGO', 'TIPPERARY', 'WATERFORD', 'WESTMEATH', 'WEXFORD', 'WICKLOW'
srcmap = ColumnDataSource(data=dict(x=rX, y02=df_map['2002'], y06=df_map['2006'], y11=df_map['2011'], y16=df_map['2016'], xs=df_map['xs'], ys=df_map['ys']))

pc = figure(title = 'test', tools = '', x_axis_location = None, y_axis_location = None)

pc.patches('xs', 'ys', fill_alpha = 0.7, line_width = 0.5, source = srcmap)
#pc.grid.grid_line_color=None
show(pc)
xstest =df_map.loc['DUBLIN']['xs']
ystest = df_map.loc['DUBLIN']['ys']
pc = figure(title = 'test', tools = '', x_axis_location = None, y_axis_location = None)
pc.patches(xs=xstest, ys=ystest, fill_alpha = 0.7, line_width = 0.5)
show(pc)