How to set the origin to O and remove the zero labels in Maxima draw?

元气小坏坏 提交于 2020-01-15 12:46:06

问题


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.

Maybe that's possible to use with the option user_preamble?


回答1:


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))$

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



来源:https://stackoverflow.com/questions/28088938/how-to-set-the-origin-to-o-and-remove-the-zero-labels-in-maxima-draw

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!