How to plot floor
function in Maxima?
f4(x) := floor(x);
How to plot floor
function in Maxima?
f4(x) := floor(x);
Gnuplot doesn't detect points of discontinuity, so you have to make them explicit.
With Gnuplot, you can do:
N=1000
set sample N
plot (abs(x-floor(x))<1./N*(GPVAL_X_MAX-GPVAL_X_MIN))?1/0:floor(x)
With Maxima, you can do the same using the gnuplot_preamble
option to set sample
:
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"]);