gpt4 book ai didi

python - Matplotlib - Jupyter 笔记本

转载 作者:行者123 更新时间:2023-11-30 22:16:00 28 4
gpt4 key购买 nike

我使用 jupyter python 中的 matplotlib 库生成了下图。正如你所看到的,我有两个不同的数据,一个是红色,另一个是绿色。我的问题是,有什么办法可以让我有一个小侧窗来说明每种颜色的含义吗? enter image description here

enter image description here

最佳答案

有一个很好的函数叫做 matplotlib.pyplot.legend()

我建议检查这个:https://matplotlib.org/api/_as_gen/matplotlib.pyplot.legend.html

关于python - Matplotlib - Jupyter 笔记本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50092460/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com