mathematica中如何使坐标轴有刻度但没有数字

 

参考GPT和自己的思路:

在 Mathematica 中,可以使用 TickMarks 参数来控制坐标轴上的刻度线,使用 LabelStyle 参数来控制刻度线上的数字样式。如果要使坐标轴上有刻度但没有数字,可以将 LabelStyle 设置为 None。以下是示例代码:

Plot[x^2, {x, -2, 2}, 
 Frame -> True, 
 FrameTicks -> {{Automatic, None}, {Automatic, None}}, 
 LabelStyle -> None]

其中,Frame -> True 表示带边框的坐标系;FrameTicks -> {{Automatic, None}, {Automatic, None}} 表示只有下、左两个轴有刻度线,但没有数字;LabelStyle -> None 表示没有数字样式。运行后得到的结果如下图所示:

![](https://img-blog.csdnimg.cn/20210608140836717.png