#248 plot3d scaling problems

closed
Raymond Toy
None
5
2003-04-03
2003-03-10
Stavros Macrakis
No

Plot3d seems to do something horrible with scaling.

Look at the following simple plot.

plot3d(x*y,[x,0,.1],[y,0,.1])

This gives a stepped plot, with only 10 distinct z values.

Along the same lines,

plot3d(x*y/1000,[x,0,1],[y,0,1]);

gives a plot with only *2* distinct z-values.

And for

plot3d(x*y,[x,0,.01],[y,0,.01])
and
plot3d(x*y/10000,[x,0,1],[y,0,1]);

I get division by zero.

Maxima version: 5.9.0
Maxima build date: 19:10 2/9/2003
host type: i686-pc-mingw32
lisp-implementation-type: Kyoto Common Lisp
lisp-implementation-version: GCL-2-5.0

Discussion

  • Logged In: YES
    user_id=588346

    A simpler error:

    plot3d(1,[x,0,1],[y,0,1]) => Error: divide by zero (tcl)

     
  • Raymond Toy
    Raymond Toy
    2003-04-03

    Logged In: YES
    user_id=28849

    Found the problem:

    (defun print-pt1 (f str)
    (format str "~,3f " f))

    Thus, only 3 decimal places are printed.

    Using either ~f or even ~,3g gives much better results.

     
  • Raymond Toy
    Raymond Toy
    2003-04-03

    • status: open --> closed
    • assigned_to: nobody --> rtoy
     
  • Raymond Toy
    Raymond Toy
    2003-04-03

    Logged In: YES
    user_id=28849

    Applied the fix ",3g". Both examples plot just fine now.