Gnuplot 如何用plot2d在maxima中绘制阶跃函数

Gnuplot 如何用plot2d在maxima中绘制阶跃函数,gnuplot,maxima,Gnuplot,Maxima,如何在Maxima中绘制floor函数 f4(x) := floor(x); 我想去掉不必要的垂直线: Gnuplot无法检测到不连续点,因此必须将其明确化 使用Gnuplot,您可以执行以下操作: N=1000 set sample N plot (abs(x-floor(x))<1./N*(GPVAL_X_MAX-GPVAL_X_MIN))?1/0:floor(x) 非常感谢。但是你能为我提供一个纯粹的maxima解决方案吗。在我的例子中,我没有通过在plot2d中设置[gnupl

如何在Maxima中绘制
floor
函数

f4(x) := floor(x);
我想去掉不必要的垂直线:

Gnuplot无法检测到不连续点,因此必须将其明确化

使用Gnuplot,您可以执行以下操作:

N=1000
set sample N
plot (abs(x-floor(x))<1./N*(GPVAL_X_MAX-GPVAL_X_MIN))?1/0:floor(x)

非常感谢。但是你能为我提供一个纯粹的
maxima
解决方案吗。在我的例子中,我没有通过在
plot2d
中设置
[gnuplot_preamble,'set sample 1000']
来消除垂直线。什么是GPVAL_X_MAX,GPVAL_X_MIN?我是否需要修改
f(x):=floor(x)
中的
maxima
行?最困难的部分是找到不连续点。我不知道如何自动做到这一点。我的建议是把这个带到Maxima邮件列表:Maxima-discuss@lists.sourceforge.net
fl(x,N,Xmin,Xmax):=if (abs(x-floor(x))<1./N*(Xmax-Xmin)) then nan else floor(x);
Xmin:-10; Xmax:10;
plot2d(fl(x,1000,Xmin,Xmax),[x,Xmin,Xmax],[gnuplot_preamble, "set sample 1000"]);