Hi Bill, Coming back to the plotPoints function, I was able to plot what I wanted, but I have some queries : Color of the points : Im able to get only 2 colors. I only get blue and pink when I change the array : value(:,0). The attached image shows trajectories of particles released from the trailing edge of a plunging airfoil. The points released from the upper side are colored in Pink and Blue on the lower side respectively. I'd like to have other colors as well. Interactive plotPoints: Also, each time I call plotPloints, I need to click "exit" for it to proceed to the next step. Is there a way to avoid this. Since I would like to see the plot dynamically. As a temporary solution, I modified the loop in plotPoints.C as : // **** Plotting loop ***** for(int i=0;i<1;i++) // This was for (int i=0 ; i++) before { if( i==0 && (plotObject || parameters.plotObjectAndExit) ) answer="plot"; // plot first time through if plotObject==TRUE else if( i==1 && parameters.plotObjectAndExit ) So now, only at the end, Im able to see the full plot without having to click "exit". Is there any other way to proceed without clicking "exit" ? Array size of points() array : The array - points() which is an argument to plotPoints works when the dimension of points() is points(N,0:2), where N is any integer. Even for 2D problems, I need to define points(N,2) and assign it to zero. Not that this is a problem, but just an information if anyone tries To use this function in 2D. Thanks, Dominic -----Original Message----- From: overture-bounce@xxxxxxxxxxxxx [mailto:overture-bounce@xxxxxxxxxxxxx] On Behalf Of #DOMINIC DENVER JOHN CHANDAR# Sent: Tuesday, June 16, 2009 11:55 PM To: overture@xxxxxxxxxxxxx Subject: [overture] Re: Plot a Point Thanks Bill, It worked fine.. Dominic -----Original Message----- From: overture-bounce@xxxxxxxxxxxxx [mailto:overture-bounce@xxxxxxxxxxxxx] On Behalf Of Bill Henshaw Sent: Tuesday, June 16, 2009 10:51 PM To: overture@xxxxxxxxxxxxx Subject: [overture] Re: Plot a Point hi Dominic, You can use the plotPoints function to plot coloured points (or spheres). Here is an example. ...Bill PlotStuff ps(true,"plot"); GraphicsParameters psp; ... else if( answer=="plot points" || answer=="plot points with colour" || answer=="plot spheres with colour" ) { const bool plotSpheres = answer=="plot spheres with colour"; const int n=plotSpheres ? 41 : 51; const int m = plotSpheres ? 2 : 1; realArray points(n,3), value(n,m); for( int i=0; i<n; i++ ) { real radius=i/(n+1.); real theta=twoPi*i/(n+1.); points(i,axis1)=cos(theta)*radius; points(i,axis2)=sin(theta)*radius; points(i,axis3)=cos(2.*theta)*radius; value(i,0)= SQR(points(i,axis1))+SQR(points(i,axis2))+SQR(points(i,axis3)); if( plotSpheres ) value(i,1)=.05; // radius for the sphere } psp.set(GI_POINT_SIZE,(real) 6.); // size in pixels if( answer=="plot points" ) ps.plotPoints(points,psp); else ps.plotPoints(points,value,psp); // colour point i by value(i) } #DOMINIC DENVER JOHN CHANDAR# wrote: > Hi, > > Is there a way to plot a point at a given location (x,y) using the > plotStuff class ? or should I use the OpenGL functions ? Basically I > have a contour plot plotted in a window and i want to plot points at > different locations (also later with different colors) > > I tried something like : > > DataPointMapping map; > map.setDataPoints( points, 1,1); > MappedGrid mg(map); > mg.update(); > > here "points" is of dimension (1, 0:1). But this doesnt work.. I think > we cannot generate a MappedGrid with just 1 point...? > > Any other ways ? > > Thanks, > Dominic > >
Attachment:
particlePath.jpg
Description: particlePath.jpg