两道数学快速题
- 如何仅删除 x 轴上的数字而不删除 y 轴上的数字?
- 是否可以在不移动功能的情况下移动 y 轴?我的意思是,我可以将 y 轴设置在 x = -5 处,而不是 x = 0 处吗?
- How do I remove the numbers on the x-axis only not the y-axis?
- Is it possible to shift the y-axis without shifting the functions? What I mean is, instead of having the y-axis at x = 0, could I have it at x = -5?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
对于大多数控制轴的选项,您可以使用两个值的列表来指定两个轴的不同行为。您目前如何删除这些号码?我能想到的唯一方法是手动指定刻度位置,而不使用标签,如下所示:
否则我猜你必须开始研究图形输出?无论如何,无论您做什么,您都可以使用这样的二元素列表将不同的选项应用于每个维度。
要重新定位轴,您可以使用选项
AxesOrigin
;在您的示例中,您将使用AxesOrigin->{-5,0}
。With most options controlling axes, you can use a list of two values to specify different behavior for the two axes. How are you currently removing the numbers? The only way I can think of off the top of my head is to manually specify tick locations, without labels, something like this:
Otherwise you'd have to start munging around with the graphics output, I guess? In any case, whatever you do, you can use a two-element list like that to apply different options to each dimension.
To relocate the axes, you can use the option
AxesOrigin
; in your example, you'd useAxesOrigin->{-5,0}
.刻度线由
Ticks
或FrameTicks
(如果Frame -> )控制。确实如此。请注意,像
ContourPlot
和DensityPlot
这样的图默认有一个框架(即Frame -> True
)。Ticks
的规范是z 刻度
仅在 3D 绘图中出现。FrameTicks
规范是Ticks
和FrameTicks
都接受Automatic
和None
使用分别为默认算法或没有刻度。因此,要仅消除 x 轴上的刻度,对于帧,
如果您想更好地控制刻度的确切位置,那么 @Jefromi 是正确的,您需要指定一个列表。
刻度
和FrameTicks
文档值得阅读以获得更好地了解如何做到这一点。但请注意,在 Mathematica 中,做任何比列出几个点更复杂的事情都是一种黑魔法,并且会导致很多挫败感。至于你的第二个问题,你使用
AxesOrigin -> {-5, 0}
正如 @Jefromi 指出的。The tick marks are controlled by either
Ticks
, orFrameTicks
ifFrame -> True
. Note, plots likeContourPlot
andDensityPlot
have a frame by default (i.e.Frame -> True
). The specification forTicks
iswhere the
z ticks
are only present for 3D plots. TheFrameTicks
specification isBoth
Ticks
andFrameTicks
accept bothAutomatic
andNone
to use the default algorithms or have no ticks, respectively. So, to eliminate only the ticks on the x-axis you doand for frames
If you want to have more control of the exact placement of the ticks, then @Jefromi is correct, you'll need to specify a list. The
Ticks
andFrameTicks
documentation are worth the read to get a better feel of how to do this. Be aware, though, that doing anything more complex than listing a few points is something of a black art in Mathematica, and leads to a lot of frustration.As to your second question, you use
AxesOrigin -> {-5, 0}
as @Jefromi pointed out.