PlotLegend
更多信息和选项
- To use PlotLegend, you first need to load the Plot Legends Package using Needs["PlotLegends`"].
- PlotLegend->{text1,text2,…} assigns text to each line in the same fashion as PlotStyle.
- PlotLegend also enables Plot and related functions to accept options for Legend, which will modify the legend produced.
范例
基本范例 (1)
Needs["PlotLegends`"]Add a legend to a plot to identify curves:
Plot[{Sin[x], Cos[x]}, {x, 0, 2Pi}, PlotLegend -> {"sine", "cosine"}]ListPlot[Table[{x, f[x]}, {f, {Sin, Cos, Log}}, {x, 0, 10, 0.5}], PlotLegend -> {"Sine", "Cosine", "Log"}, LegendPosition -> {1.1, -0.4}, Joined -> {True, True, False}, PlotMarkers -> Automatic]技术笔记
相关指南
文本
Wolfram Research (2007),PlotLegend,Wolfram 语言函数,https://reference.wolfram.com/language/PlotLegends/ref/PlotLegend.html.
CMS
Wolfram 语言. 2007. "PlotLegend." Wolfram 语言与系统参考资料中心. Wolfram Research. https://reference.wolfram.com/language/PlotLegends/ref/PlotLegend.html.
APA
Wolfram 语言. (2007). PlotLegend. Wolfram 语言与系统参考资料中心. 追溯自 https://reference.wolfram.com/language/PlotLegends/ref/PlotLegend.html 年
BibTeX
@misc{reference.wolfram_2026_plotlegend, author="Wolfram Research", title="{PlotLegend}", year="2007", howpublished="\url{https://reference.wolfram.com/language/PlotLegends/ref/PlotLegend.html}", note=[Accessed: 07-September-2026]}
BibLaTeX
@online{reference.wolfram_2026_plotlegend, organization={Wolfram Research}, title={PlotLegend}, year={2007}, url={https://reference.wolfram.com/language/PlotLegends/ref/PlotLegend.html}, note=[Accessed: 07-September-2026]}