我在Layer Vector上具有PointFeature,在vectorLayer上具有LineString。我试图选择用于显示弹出窗口的点要素,然后也选择用于显示弹出窗口的lineString。 但是,当我首先选择pointFeature时,无法选择lineString。
import matplotlib.pyplot as plt
import numpy as np
from fruits import friutchart
def main():
fig = plt.figure()
ax = fig.add_subplot(111)
labels = ['Fruits', 'Vegetables','Pulses']
size=[35, 20, 55]
y_pos=np.arange(len(labels))
wedges = ax.bar(y_pos,size)
plt.xlabel("Eatables")
plt.ylabel("Count")
plt.xticks(y_pos,labels)
plt.title("FRUITS VEGETABLES AND PULSES COUNT")
make_picker(fig,wedges)
plt.show()
def make_picker(fig, wedges):
def onclick(event):
wedge = event.artist
label = wedge.get_label()
fruitchart()
for wedge in wedges:
wedge.set_picker(True)
fig.canvas.mpl_connect('pick_event', onclick)
if __name__ == '__main__':
main()