Opened 12 years ago

Last modified 8 years ago

#9708 new defect

Jmol options to plot3d are not passed on to show

Reported by: was Owned by: jason, was
Priority: major Milestone: sage-6.4
Component: graphics Keywords: plot3d mesh
Cc: kcrisman, novoselt, kini, gutow Merged in:
Authors: Reviewers:
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges

Description

I tried the plot3d example that involves "mesh=True" and it is completely broken. The plot simply doesn't show a mesh at all.

plot3d(sin(x-y)*y*cos(x),(x,-3,3),(y,-3,3), mesh=True)

a 3d plot, but with no mesh?

Change History (15)

comment:1 Changed 11 years ago by kcrisman

  • Cc kcrisman added

comment:2 Changed 11 years ago by novoselt

  • Cc novoselt added

comment:3 Changed 10 years ago by kini

  • Cc kini added
  • Keywords plot3d mesh added

comment:4 Changed 10 years ago by jason

See #6184 for a previous fix for this.

comment:5 Changed 10 years ago by jason

  • Cc gutow added

And #2741 originally implemented these options, so it might also contain clues.

Also CCing Jonathan, who likely knows exactly what the problem is with mesh and dots not working in 3d plots.

comment:6 Changed 10 years ago by jason

It looks like the mesh actually works, but the keywords just aren't getting passed to show. See http://test.sagenb.org/home/pub/25/

plot3d(f,(x,-3,3),(y,-3,3),mesh=True) doesn't work, but plot3d(f,(x,-3,3),(y,-3,3)).show(mesh=True) does work.

comment:7 Changed 10 years ago by kcrisman

Good sleuthing. I feel like we might have even discovered that at the JMM booth. I wonder why #6184 is no longer sufficient?

comment:8 Changed 10 years ago by gutow

I don't have much time to look at this now, but it is very mysterious as #6184, is definitely still in. Maybe we're not calling show properly after building the data set. 

comment:9 Changed 10 years ago by kcrisman

  • Summary changed from mesh= option to plot3d is completely broken? to Jmol options to plot3d are not passed on to show

This just came up again (see this interact, for instance) in the PREP 2012 workshop, as I was trying to help someone set orientation.

Repeating Jason's example from this context,

    p2=plot3d(f(x,y),(x,-5,5),(y,-5,5))
    show(p2,figsize=3,mesh=True,orientation=(0,0,0,0))

works, but

    p2=plot3d(f(x,y),(x,-5,5),(y,-5,5),mesh=True,orientation=(0,0,0,0))

doesn't. (Doesn't matter what f is, pick your favorite.)

#6184 turns out to be a red herring; we are not passing the keywords on, as Jason pointed out. Hopefully this won't be too hard to fix.

comment:10 Changed 9 years ago by leif

Ping. (Just received the same question on the IRC. ask.sagemath.org gives the work-around though.)

comment:11 Changed 9 years ago by jdemeyer

  • Milestone changed from sage-5.11 to sage-5.12

comment:12 Changed 8 years ago by vbraun_spam

  • Milestone changed from sage-6.1 to sage-6.2

comment:13 Changed 8 years ago by vbraun_spam

  • Milestone changed from sage-6.2 to sage-6.3

comment:14 Changed 8 years ago by vbraun_spam

  • Milestone changed from sage-6.3 to sage-6.4

comment:15 Changed 8 years ago by kcrisman

Okay, I think the problem here is likely to be that in all the 3d plot stuff in src/sage/plot/plot3d/plot3d.py usually puts ALL keywords into something like

texture = Texture(kwds)

and it's never seen again. But in src/sage/plot/plot3d/texture.py the initialization of Texture_class (which is called by Texture) is

    def __init__(self, id, color=(.4, .4, 1), opacity=1, ambient=0.5, diffuse=1, specular=0, shininess=1, name=None, **kwds):

never then uses any of the kwds. I can imagine fixing this by only allowing "used" keywords to be passed on to Texture and the rest (somehow) are passed on to show(), or by doing something in Texture_class. I would prefer the former.

Note: See TracTickets for help on using tickets.