BarLegend
更多信息和选项
- BarLegend 使用与色彩函数 cf 相关联的颜色列表来识别可视化图形或其他图例项中位于 min 和 max 之间的 contours.
- 在诸如 ContourPlot 和 ListContourPlot 等函数中,BarLegend 自动被启用.
- 在可视化函数中,BarLegend[Automatic,…] 中的 Automatic 自动由实际色彩函数、数据范围和等值线规范(用于确定等值线的值和等值线之间的颜色)取代.
- 在 BarLegend 中,contours 可以取以下形式:
-
n n 个等间距层的等值线 Automatic 自动选择等值线 All 全部等值线 None 无等值线 {Automatic,n} 至多 n 个自动选择的等值线 {f1,f2,…} 在层 fi 的等值线 {{f1,gr1},…} 由图形指令 gri 绘制的等值线 func 应用于 zmin, zmax 从而得到等值线列表的函数 - BarLegend[cf,contours] 可以使用颜色列表或取决于等值线数值的密度的连续色谱.
- Legended[expr,BarLegend[…]] 可用于将图例应用于任意表达式 expr.
- 可以给出以下选项:
-
LabelStyle Automatic 标签所用的样式 LegendFunction Identity 用于全局图例的封装 LegendLabel None 图例的全局标签 LegendLayout Automatic 图例布局 LegendMargins Automatic 图例内容和边界之间的空间 LegendMarkers None 用于表示每个元素的标记 LegendMarkerSize Automatic 形状的尺寸 - BarLegend 在 StandardForm 中显示为图形对象. 在 InputForm 中,它显示为色彩函数、数据范围的等值线数值的显式列表.
- 在 BarLegend 中,LegendLayout 可取以下形式:
-
Automatic 自动确定布局 "Row" 在水平行中显示图例 "Column" 在垂直列中显示图例 - 在 LineLegend 中,LegendLayout 可取以下形式:
-
Automatic 自动确定布局 "Row" 在水平行中显示图例 "Column" 在垂直列中显示图例 "ReversedRow" 在水平行中显示逆向图例 "ReversedColumn" 在垂直列中显示逆向图例 - LegendFunction 被应用于图例,包括所有全局标签和边幅.
范例
打开所有单元 关闭所有单元范围 (22)
等值线 (10)
图形图例 (8)
密度和等值线图使用 BarLegend:
用 Placed 改变图例位置:
BarLegend 根据长宽比自动改变位置和大小:
BarLegend 自动选取 ColorFunction 和 ColorFunctionScaling 的值:
BarLegend 自动选取等值线的值:
BarLegend 包括指定的等值线样式:
BarLegend 匹配等值线之间的阴影样式:
使用 BarLegend 给自动计算的图例指定标签和边框:
选项 (20)
LabelStyle (3)
LegendLabel (6)
LegendMarkerSize (2)
相关指南
-
▪
- 图例 ▪
- 函数可视化 ▪
- 数据可视化 ▪
- 图表标签、图例和注解 ▪
- 标签
文本
Wolfram Research (2012),BarLegend,Wolfram 语言函数,https://reference.wolfram.com/language/ref/BarLegend.html.
CMS
Wolfram 语言. 2012. "BarLegend." Wolfram 语言与系统参考资料中心. Wolfram Research. https://reference.wolfram.com/language/ref/BarLegend.html.
APA
Wolfram 语言. (2012). BarLegend. Wolfram 语言与系统参考资料中心. 追溯自 https://reference.wolfram.com/language/ref/BarLegend.html 年
BibTeX
@misc{reference.wolfram_2025_barlegend, author="Wolfram Research", title="{BarLegend}", year="2012", howpublished="\url{https://reference.wolfram.com/language/ref/BarLegend.html}", note=[Accessed: 18-April-2026]}
BibLaTeX
@online{reference.wolfram_2025_barlegend, organization={Wolfram Research}, title={BarLegend}, year={2012}, url={https://reference.wolfram.com/language/ref/BarLegend.html}, note=[Accessed: 18-April-2026]}