如何在Maxima draw中将原点设置为O并删除零标签? [英] How to set the origin to O and remove the zero labels in Maxima draw?
问题描述
Maxima中的draw(2d)函数具有一些控制轴的设置,但据我所知,没有一个隐藏xy轴的零标签并将其替换为0或O.
The draw (2d) function in Maxima has several settings to control the axis, but as far as I can tell, none that hides the zero label of the xy-axis and to replace it with either a 0 or a O.
也许可以与选项user_preamble一起使用?
Maybe that's possible to use with the option user_preamble?
推荐答案
您将需要显式设置xtics
和ytics
值,省略原点,并使用label
标记原点.
You will need to set the xtics
and ytics
values explicitly, omitting the origin, and use label
to label the origin.
load(draw)$
draw2d( user_preamble="set zeroaxis linetype 5; set xtics axis;
set ytics axis; set border 0;",
xtics={-3, -2, -1, 1, 2, 3},
ytics={-1, -1/2, 1/2, 1},
label(["O", 0, 0]),
explicit(sin(x),x,-%pi, %pi))$
如果您不希望在上面的示例中将原点标签显示在交叉点处,则可以调整标签坐标.用label(["O", -0.15, 0.1])
替换label(["O",0,0])
给出
You can tweak the label coordinates if you don't want the origin label to appear right at the intersection in my example above. Replacing label(["O",0,0])
with label(["O", -0.15, 0.1])
gives
这篇关于如何在Maxima draw中将原点设置为O并删除零标签?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!