两道数学快速题

发布于 2024-09-02 22:20:26 字数 117 浏览 4 评论 0原文

  1. 如何仅删除 x 轴上的数字而不删除 y 轴上的数字?
  2. 是否可以在不移动功能的情况下移动 y 轴?我的意思是,我可以将 y 轴设置在 x = -5 处,而不是 x = 0 处吗?
  1. How do I remove the numbers on the x-axis only not the y-axis?
  2. 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

棒棒糖 2024-09-09 22:20:27

对于大多数控制轴的选项,您可以使用两个值的列表来指定两个轴的不同行为。您目前如何删除这些号码?我能想到的唯一方法是手动指定刻度位置,而不使用标签,如下所示:

Ticks -> {{{0, ""}, {1, ""}, {2, ""}}, Automatic}

否则我猜你必须开始研究图形输出?无论如何,无论您做什么,您都可以使用这样的二元素列表将不同的选项应用于每个维度。

要重新定位轴,您可以使用选项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:

Ticks -> {{{0, ""}, {1, ""}, {2, ""}}, Automatic}

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 use AxesOrigin->{-5,0}.

秉烛思 2024-09-09 22:20:27

刻度线由 TicksFrameTicks(如果 Frame -> )控制。确实如此。请注意,像 ContourPlotDensityPlot 这样的图默认有一个框架(即 Frame -> True)。 Ticks 的规范是

Ticks -> {<x ticks>, <y ticks>, <z ticks>}

z 刻度 仅在 3D 绘图中出现。 FrameTicks 规范是

FrameTicks -> { {left, right}, {bottom, top} }

TicksFrameTicks 都接受 AutomaticNone 使用分别为默认算法或没有刻度。因此,要仅消除 x 轴上的刻度

Ticks -> { None, Automatic }

,对于帧,

FrameTicks -> { {Automatic, Automatic}, {None, None} }

如果您想更好地控制刻度的确切位置,那么 @Jefromi 是正确的,您需要指定一个列表。 刻度FrameTicks 文档值得阅读以获得更好地了解如何做到这一点。但请注意,在 Mathematica 中,做任何比列出几个点更复杂的事情都是一种黑魔法,并且会导致很多挫败感。

至于你的第二个问题,你使用 AxesOrigin -> {-5, 0} 正如 @Jefromi 指出的。

The tick marks are controlled by either Ticks, or FrameTicks if Frame -> True. Note, plots like ContourPlot and DensityPlot have a frame by default (i.e. Frame -> True). The specification for Ticks is

Ticks -> {<x ticks>, <y ticks>, <z ticks>}

where the z ticks are only present for 3D plots. The FrameTicks specification is

FrameTicks -> { {left, right}, {bottom, top} }

Both Ticks and FrameTicks accept both Automatic and None to use the default algorithms or have no ticks, respectively. So, to eliminate only the ticks on the x-axis you do

Ticks -> { None, Automatic }

and for frames

FrameTicks -> { {Automatic, Automatic}, {None, None} }

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 and FrameTicks 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文