简介
Matplotlib 是一个用于 Python 的数据可视化库。它提供了各种工具,可在 Python 中创建静态、动画和交互式可视化。Matplotlib 的交互式功能之一是能够检测鼠标何时进入和离开图形或坐标轴。在本实验中,我们将学习如何使用 Matplotlib 的图形和坐标轴进入/离开事件来更改图形和坐标轴的边框颜色。
虚拟机使用提示
虚拟机启动完成后,点击左上角切换到“笔记本”标签,以访问 Jupyter Notebook 进行练习。
有时,你可能需要等待几秒钟让 Jupyter Notebook 完成加载。由于 Jupyter Notebook 的限制,操作验证无法自动化。
如果你在学习过程中遇到问题,随时向 Labby 提问。课程结束后提供反馈,我们将立即为你解决问题。
Skills Graph
%%%%{init: {'theme':'neutral'}}%%%%
flowchart RL
matplotlib(("Matplotlib")) -.-> matplotlib/BasicConceptsGroup(["Basic Concepts"])
python(("Python")) -.-> python/DataStructuresGroup(["Data Structures"])
python(("Python")) -.-> python/FunctionsGroup(["Functions"])
python(("Python")) -.-> python/ModulesandPackagesGroup(["Modules and Packages"])
matplotlib(("Matplotlib")) -.-> matplotlib/AdvancedTopicsGroup(["Advanced Topics"])
python(("Python")) -.-> python/DataScienceandMachineLearningGroup(["Data Science and Machine Learning"])
matplotlib/BasicConceptsGroup -.-> matplotlib/importing_matplotlib("Importing Matplotlib")
matplotlib/BasicConceptsGroup -.-> matplotlib/figures_axes("Understanding Figures and Axes")
python/DataStructuresGroup -.-> python/tuples("Tuples")
python/FunctionsGroup -.-> python/function_definition("Function Definition")
python/FunctionsGroup -.-> python/build_in_functions("Build-in Functions")
python/ModulesandPackagesGroup -.-> python/importing_modules("Importing Modules")
matplotlib/AdvancedTopicsGroup -.-> matplotlib/event_handling("Event Handling")
python/DataScienceandMachineLearningGroup -.-> python/data_visualization("Data Visualization")
subgraph Lab Skills
matplotlib/importing_matplotlib -.-> lab-48730{{"Matplotlib 图形和坐标轴的进入/离开事件"}}
matplotlib/figures_axes -.-> lab-48730{{"Matplotlib 图形和坐标轴的进入/离开事件"}}
python/tuples -.-> lab-48730{{"Matplotlib 图形和坐标轴的进入/离开事件"}}
python/function_definition -.-> lab-48730{{"Matplotlib 图形和坐标轴的进入/离开事件"}}
python/build_in_functions -.-> lab-48730{{"Matplotlib 图形和坐标轴的进入/离开事件"}}
python/importing_modules -.-> lab-48730{{"Matplotlib 图形和坐标轴的进入/离开事件"}}
matplotlib/event_handling -.-> lab-48730{{"Matplotlib 图形和坐标轴的进入/离开事件"}}
python/data_visualization -.-> lab-48730{{"Matplotlib 图形和坐标轴的进入/离开事件"}}
end