简介
在本实验中,我们将学习如何在Matplotlib中创建多色线条。我们将使用 LineCollection
函数创建一组线段,并根据它们的导数分别为其着色。我们还将学习如何使用边界规范为线段着色。
虚拟机使用提示
虚拟机启动完成后,点击左上角切换到 笔记本 标签页,以访问Jupyter Notebook进行练习。
有时,你可能需要等待几秒钟让Jupyter Notebook完成加载。由于Jupyter Notebook的限制,操作验证无法自动化。
如果你在学习过程中遇到问题,随时向Labby提问。课程结束后提供反馈,我们将立即为你解决问题。
Skills Graph
%%%%{init: {'theme':'neutral'}}%%%%
flowchart RL
matplotlib(("Matplotlib")) -.-> matplotlib/BasicConceptsGroup(["Basic Concepts"])
python(("Python")) -.-> python/DataScienceandMachineLearningGroup(["Data Science and Machine Learning"])
python(("Python")) -.-> python/BasicConceptsGroup(["Basic Concepts"])
python(("Python")) -.-> python/DataStructuresGroup(["Data Structures"])
python(("Python")) -.-> python/FunctionsGroup(["Functions"])
python(("Python")) -.-> python/ModulesandPackagesGroup(["Modules and Packages"])
matplotlib/BasicConceptsGroup -.-> matplotlib/importing_matplotlib("Importing Matplotlib")
matplotlib/BasicConceptsGroup -.-> matplotlib/figures_axes("Understanding Figures and Axes")
python/BasicConceptsGroup -.-> python/booleans("Booleans")
python/DataStructuresGroup -.-> python/lists("Lists")
python/DataStructuresGroup -.-> python/tuples("Tuples")
python/FunctionsGroup -.-> python/build_in_functions("Build-in Functions")
python/ModulesandPackagesGroup -.-> python/importing_modules("Importing Modules")
python/DataScienceandMachineLearningGroup -.-> python/numerical_computing("Numerical Computing")
python/DataScienceandMachineLearningGroup -.-> python/data_visualization("Data Visualization")
subgraph Lab Skills
matplotlib/importing_matplotlib -.-> lab-48836{{"在 Matplotlib 中创建多色线条"}}
matplotlib/figures_axes -.-> lab-48836{{"在 Matplotlib 中创建多色线条"}}
python/booleans -.-> lab-48836{{"在 Matplotlib 中创建多色线条"}}
python/lists -.-> lab-48836{{"在 Matplotlib 中创建多色线条"}}
python/tuples -.-> lab-48836{{"在 Matplotlib 中创建多色线条"}}
python/build_in_functions -.-> lab-48836{{"在 Matplotlib 中创建多色线条"}}
python/importing_modules -.-> lab-48836{{"在 Matplotlib 中创建多色线条"}}
python/numerical_computing -.-> lab-48836{{"在 Matplotlib 中创建多色线条"}}
python/data_visualization -.-> lab-48836{{"在 Matplotlib 中创建多色线条"}}
end