如何选择mathematica中绘图轴上显示的数字?
我已经检查了 Mathematica 文档中心中的所有示例和设置,但找不到任何有关如何选择将在轴上显示的数字的示例。
如何将绘图轴编号(如 2,4,6,..)更改为 PI,2PI,3PI,...?
I have already checked all the examples and settings in the Mathematica documentation center, but couldn't find any example on how to choose the numbers that will be shown on the axes.
How do I change plot axis numbering like 2,4,6,.. to PI,2PI,3PI,...?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
如果您希望标签
Pi
、2 Pi
等处于值<,Howard 已经给出了正确答案/em>Pi
、2 Pi
等。有时您可能希望在特定值处使用替代刻度标签,而不重新缩放数据。
文档中的其他示例之一显示了如何:
我有一套用于格式化的小型自定义函数 < code>Ticks 按照我想要的方式。如果您刚刚开始,这可能是太多信息,但值得知道的是,您可以使用任何数字格式,并根据需要将任何内容替换到您的刻度中。
并设置:
示例:
Howard has already given the correct answer in the case where you want the labels
Pi
,2 Pi
etc to be at the valuesPi
,2 Pi
etc.Sometimes you might want to use substitute tick labels at particular values, without rescaling data.
One of the other examples in the documentation shows how:
I have a suite of small custom functions for formatting
Ticks
the way I want them. This is probably too much information if you are just starting out, but it is worth knowing that you can use any number format and substitute anything into your ticks if desired.And setting:
Example:
您可以在此处找到示例:
You can find an example here:
Ticks
还接受一个函数,这将省去您手动列出点或每次更改最大值的麻烦。下面是一个示例:如果您希望更灵活地自定义刻度,您可能需要查看 LevelScheme。
Ticks
also accepts a function, which will save you the trouble of listing the points manually or having to change the max value each time. Here's an example:If you want more flexibility in customizing your ticks, you might want to look into LevelScheme.