I can't explain what I'm seeing and I'm hoping it is a Teachable Moment where I can learn something about graphics events. I don't want a workaround - I have a workaround - I want exegesis.
My app is using Plot to create plots of an evolving simulation, so I create an isigraph, run a step of simulation, and then plot some variables. The plot changes with every timestep. The code I use to create the form is: wd FORM ob=: conew 'jzplot' NB. create plot object PForm__ob=: 'form' NB. define PForm in loc PFormhwnd__ob=: wd 'qhwndp' NB. define PFormhwnd in loc PId__ob=: 'isi' NB. define PId in loc wd 'pshow;' At this point the form comes up (because I did pshow) but it is empty (because I haven't plotted anything). Then I run my simulation step, which looks like 'type dot;pensize 5' plot__ob x;y and NOTHING SHOWS UP. That's the mystery. Why doesn't the screen get painted? If I minimize the form and maximize it, the plot appears. This suggests that what is missing is a call to _paint after the plot is prepared (minimize/maximize generates a _paint call which draws the isigraph). It's not that there is never a _paint call, because if I run another simulation step, in other words issue a second 'type dot;pensize 5' plot__ob x;y , now the correct data from the second step is displayed. And all subsequent steps correctly update the display with the current data (I'm sure that it's not one step behind). So why is the first _paint missing? What's different between the first plot and all subsequent plots? Henry Rich > -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Zach Reiter > Sent: Friday, March 16, 2007 9:30 PM > To: Programming forum > Subject: Re: [Jprogramming] Need 3D point plot > > Does the following modification to the definition of > plot3d_dot_jzplot_ > work? > > plot3d_dot_jzplot_ =: 3 : 0 > > 'x y z'=. y { Data > > dat=. 1 |: (x ,: y),"2 1 citemize z > dat=.fit3d"2 dat > dat=. ,"2 dat > > rws=. #dat > cls=. {:$dat > clr=. getitemcolor #dat > > rws=. 1 > > while. #dat do. > NB. drawcircle iDATA;({.clr);4;({.clr);1,.~ _2[\{.dat > drawdot iDATA;({.clr);PENSIZE;_2[\{.dat > dat=. }.dat > clr=. 1|.clr > end. > ) > > Try: > > cube=:#:i.8 > 'type dot;pensize 5'plot ;/|:cube > > Cheers, > Zach > > On Fri, 16 Mar 2007 17:05:49 -0400, "Henry Rich" > <[EMAIL PROTECTED]> > said: > > I have a 3D dataset that I need to plot as a field of > > 3D points. It doesn't look like I can do this with > > Plot, which is a real shame, because I just want something > > that will quickly draw a 3D viewbox and plot a marker at > > each point. The marker or the point style would be perfect. > > > > Am I missing something - is there a way to do this? > > > > If not: is there any reason this couldn't be added to plot? > > Could anyone give me a hint about where the changes would > > need to go? > > > > Henry Rich > > > > > ---------------------------------------------------------------------- > > For information about J forums see > http://www.jsoftware.com/forums.htm > ---------------------------------------------------------------------- > For information about J forums see > http://www.jsoftware.com/forums.htm ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
