python - 更改图例的 edgecolor 和 textcolor
问题描述
我正在尝试更改图例的边缘颜色和文本颜色(请参见下面的输出)。
我正在使用 geopandas 来创建地理图。
fig, ax = plt.subplots(1, 1, figsize=(10,5))
divider = make_axes_locatable(ax)
cax = divider.append_axes("bottom", size="5%", pad=0.2)
merge.plot(ax=ax, column='Interest', cmap="Blues", legend=True, cax=cax,
legend_kwds={'label': "Interest by Country", "orientation": "horizontal"})
merge.boundary.plot(ax=ax, color="darkgray", linewidth=0.25)
ax.grid(False)
ax.axes.yaxis.set_visible(False)
ax.axes.xaxis.set_visible(False)
plt.show()
输出:
解决方案
推荐阅读
- reactjs - 如何使用 Jest 模拟 React `@material-ui/icons` 中的所有图标?
- amazon-web-services - Kubectl apply 无法创建 EBS 卷持久卷声明
- ios - iOS Firebase 检测到事件中的崩溃,但无法识别 Crashlytics 部分中的应用程序
- javascript - 我需要帮助如何处理最大调用堆栈?
- angular - 如何在角度11中合并两个或多个数组
- reactjs - 条件渲染 + React
- api - 在 API AUTOMATION 中打印响应时获取“io.restassured.internal.RestAssuredResponseImpl@268cbb86”
- svelte - 附加到页面的苗条样式 HTML
- python - InvalidArgumentError: unique 需要一维向量
- excel - 如何在 For Each 循环之外创建一个 vbYesNo MsgBox?