Bug in list_plot3d?

24 views
Skip to first unread message

P Purkayastha

unread,
Apr 1, 2012, 3:56:41 AM4/1/12
to sage-s...@googlegroups.com
If I plot 2 points using list_plot3d, then they are correctly joined by a line. If I increase the number of points to 3, then I don't get a plane and instead get a bizarre shape with a "floor" suddenly appearing out of nowhere. See the output of

list_plot3d([(0,0,1), (1,2,2), (0,1,0)], interpolation='nn', num_points=200, point_list=True)


Is this a bug in list_plot3d?

kcrisman

unread,
Apr 3, 2012, 10:11:23 PM4/3/12
to sage-s...@googlegroups.com


On Sunday, April 1, 2012 3:56:41 AM UTC-4, P Purkayastha wrote:
If I plot 2 points using list_plot3d, then they are correctly joined by a line. If I increase the number of points to 3, then I don't get a plane and instead get a bizarre shape with a "floor" suddenly appearing out of nowhere. See the output of

list_plot3d([(0,0,1), (1,2,2), (0,1,0)], interpolation='nn', num_points=200, point_list=True)


    if isinstance(v, list):
        if len(v) == 0:
            # return empty 3d graphic
            from base import Graphics3d
            return Graphics3d()
        elif len(v) == 1:
            # return a point
            from shapes2 import point3d
            return point3d(v[0], **kwds)
        elif len(v) == 2:
            # return a line
            from shapes2 import line3d
            return line3d(v, **kwds)

But then it returns a list_plot3d_tuples and apparently this function is extended by zero outside of its surface.  I guess that makes sense.  Maybe we should also special-case len(v)==3 to make a plane?  I don't use this, so I don't know whether that would be good or bad to change for the "typical" use case.

P Purkayastha

unread,
Apr 4, 2012, 1:32:27 AM4/4/12
to sage-s...@googlegroups.com

I uploaded a patch at http://trac.sagemath.org/sage_trac/ticket/12798 to
fix this issue. It needs a review. :)

Reply all
Reply to author
Forward
0 new messages