是二维图形函数的一个选项,指定边框的刻度.
FrameTicks
是二维图形函数的一个选项,指定边框的刻度.
更多信息
- 可以对 FrameTicks 给出下面的设置:
-
None 不绘制刻度 Automatic 自动放置刻度 True 自动在底部和左边放置刻度 All 自动在每边放置刻度 {{left,right},{bottom,top}} 分别指定每边的刻度选项 - 当各边的刻度分别确定时,All 指定应该包含刻度记号标签.
- 自动刻度标记通常将标记放在十进制表示中最小数值的点的坐标上.
- 对于每条边,可以给出以下刻度选项:
-
None 不绘制刻度线 Automatic 自动选择刻度线位置和标签 All 自动位置有标签 {x1,x2,…} 在指定位置绘制刻度线 {{x1,label1},{x2,label2},…} 用指定标签绘制刻度线 {{x1,label1,len1},…} 具有指定缩放长度的刻度线 { { x 1 , label 1 , { plen 1 , mlen 1 } } , … }在正方向和负方向上指定长度的刻度线 {{x1,label1,len1,style1},…} 指定样式的刻度线 func 应用于 xmin、xmax 的函数,以获得刻度线规范 - 如果没有给出明确的标签,则以刻度线位置的数值给出刻度线标签.
- 任何表达式都可以作为刻度线标签.
- 刻度线长度是整个绘图距离的一部分.
- 刻度线样式可涉及任何图形指令.
- 刻度线函数 func[xmin,xmax] 可以返回任何其他刻度线选项.
- FrameTicksStyle 为框架刻度线和刻度线标签提供默认样式.
- 只有在绘制框架本身时,才会显示框架刻度,如 Frame 所指定.
范例
打开所有单元 关闭所有单元基本范例 (4)
Plot[Sin[x], {x, 0, 10}, Frame -> True, FrameTicks -> None]Plot[Sin[x], {x, 0, 10}, Frame -> True, FrameTicks -> Automatic]LogLogPlot[Abs[(ω I - 1)(ω I + 1) / ((ω I + 10)(ω I - 10))], {ω, 1, 10 ^ 3}, Frame -> True, FrameTicks -> Automatic]Plot[Sin[x], {x, 0, 10}, Frame -> True, FrameTicks -> {{{-1, 0, 1}, None}, {{0, Pi, 2Pi, 3Pi}, None}}]用 FrameTicksStyle 指定边框刻度的整体样式,包括标签:
Plot[Sin[x], {x, 0, 10}, Frame -> True, FrameTicksStyle -> Directive[Orange, 12]]范围 (10)
FrameTicks 位置和坐标 (4)
Plot[Sin[x], {x, 0, 10}, Frame -> True, FrameTicks -> All]Plot[Sin[x], {x, 0, 10}, Frame -> True, FrameTicks -> {{All, None}, {None, None}}]Plot[Sin[x], {x, 0, 10}, Frame -> True, FrameTicks -> {{None, All}, {None, All}}]Plot[Sin[x], {x, 0, 10}, Frame -> True, FrameTicks -> {{None, {-1 / 2, 1 / 2}}, {{0, Pi, 2Pi, 3Pi}, None}}]Plot[Sin[x], {x, 0, 10}, Frame -> True, FrameTicks -> {{{0, 0°}, {Pi, 180°}, {2Pi, 360°}, {3Pi, 540°}}, {-1 / 2, 1 / 2}}]FrameTicks 样式 (6)
Plot[Cos[x], {x, 0, 10}, Frame -> True, FrameTicks -> {{{0, 0°, .2}, {Pi, 180°, .2}, {2Pi, 360°, .2}, {3Pi, 540°, .2}}, {-1 / 2, 1 / 2}}]Plot[Cos[x], {x, 0, 10}, Frame -> True, FrameTicks -> {{{0, 0°, {.4, .05}}, {Pi, 180°, {.4, .05}}, {2Pi, 360°, {.4, .05}}, {3Pi, 540°, {.4, 0.05}}}, {-1 / 2, 1 / 2}}]Plot[Cos[x], {x, 0, 10}, Frame -> True, FrameTicks -> {{{Pi, 180°, {.4, .05}, Red}, {2Pi, 360°, {.4, .05}, Thick}, {3Pi, 540°, {.4, .05}, Directive[Red, Dashed]}}, {-1, 1}}]用 FrameTicksStyle 指定整体的边框刻度:
Plot[Cos[x], {x, 0, 10}, Frame -> True, FrameTicks -> All, FrameTicksStyle -> Directive[Orange, 12]]Plot[Cos[x], {x, 0, 10}, Frame -> True, FrameTicks -> All, FrameTicksStyle -> {{Black, Blue}, {Red, Green}}]用 FrameTicksStyle 可以分别指定边框刻度,它具有较高的优先级:
Plot[Cos[x], {x, 0, 10}, Frame -> True, FrameTicks -> {{0, {Pi, Pi, {.4, 0}, Directive[Blue, Dashed]}, 2Pi, 3Pi}, None}, FrameTicksStyle -> Directive[Orange, 12]]推广和延伸 (1)
属性和关系 (6)
FrameTicksStyle 影响边框刻度和刻度标签:
Plot[2Sin[x], {x, 0, 10}, Frame -> True, FrameLabel -> {x, y}, PlotLabel -> 2Sin[x], FrameTicksStyle -> Green]LabelStyle 提供所有标签类元素的整体样式,包括边框刻度标签:
Plot[2Sin[x], {x, 0, 10}, Frame -> True, FrameLabel -> {x, y}, PlotLabel -> 2Sin[x], LabelStyle -> Directive[Red, FontFamily -> "Helvetica"]]FrameTicksStyle 可以和 LabelStyle 连用,并具有更高优先级:
Plot[2Sin[x], {x, 0, 10}, Frame -> True, FrameLabel -> {x, y}, PlotLabel -> 2Sin[x], LabelStyle -> Directive[Red, FontFamily -> "Helvetica"], FrameTicksStyle -> Green]FrameStyle 影响边框、边框标签、边框刻度和边框刻度标签的样式:
Plot[2Sin[x], {x, 0, 10}, Frame -> True, FrameLabel -> {x, y}, PlotLabel -> 2Sin[x], FrameStyle -> Directive[Gray, FontSize -> 15]]FrameTicksStyle 可以和 FrameStyle 连用,并具有更高优先级:
Plot[2Sin[x], {x, 0, 10}, Frame -> True, FrameLabel -> {x, y}, PlotLabel -> 2Sin[x], FrameStyle -> Directive[Gray, FontSize -> 15], FrameTicksStyle -> Green]Plot[Cos[x], {x, 0, 10}, Frame -> True, FrameTicks -> {{0, {Pi, Pi, {.4, 0}, Directive[Blue, Thick]}, 2Pi, 3Pi}, None}, FrameStyle -> Directive[Gray, Dashed], FrameTicksStyle -> Directive[Orange, 12]]Ticks 控制坐标轴上的刻度和刻度标签:
Graphics[Circle[], Axes -> True, Ticks -> Automatic]用 DateListPlot 获得对应日期和时间的边框刻度:
DateListPlot[FinancialData["IBM", "Jan. 1, 2004"]]历史
1991年引入 (2.0) | 在以下年份被更新:2007 (6.0) ▪ 2008 (7.0)
文本
Wolfram Research (1991),FrameTicks,Wolfram 语言函数,https://reference.wolfram.com/language/ref/FrameTicks.html (更新于 2008 年).
CMS
Wolfram 语言. 1991. "FrameTicks." Wolfram 语言与系统参考资料中心. Wolfram Research. 最新版本 2008. https://reference.wolfram.com/language/ref/FrameTicks.html.
APA
Wolfram 语言. (1991). FrameTicks. Wolfram 语言与系统参考资料中心. 追溯自 https://reference.wolfram.com/language/ref/FrameTicks.html 年
BibTeX
@misc{reference.wolfram_2026_frameticks, author="Wolfram Research", title="{FrameTicks}", year="2008", howpublished="\url{https://reference.wolfram.com/language/ref/FrameTicks.html}", note=[Accessed: 13-November-2026]}
BibLaTeX
@online{reference.wolfram_2026_frameticks, organization={Wolfram Research}, title={FrameTicks}, year={2008}, url={https://reference.wolfram.com/language/ref/FrameTicks.html}, note=[Accessed: 13-November-2026]}