Re: Changing a graph

Bruce Sherwood <[email protected]> Fri, 9 Nov 2012 19:44:56 -0700
Newsgroups gmane.comp.python.visualpython.user
Message-ID <CAFDG03gwLScmCJ15oEyzjQaxxjB2OEwMGmskdXE0nO2J6+QpSw@mail.gmail.com>
Perhaps this is what you're looking for:

from visual import *
from visual.graph import *
# From the VPython Help:
#    If you say g = gcurve(), g.gcurve is
#    a curve object used to represent the gcurve.
#    Every gdisplay has the attribute "display".
d = gdisplay()
g = gcurve()
g.plot(pos=(2,1))
g.plot(pos=(5,3))
d.display.mouse.getclick()
g.gcurve.pos = [(1,3), (4,1)]

Bruce Sherwood

On Fri, Nov 9, 2012 at 6:02 PM, Brian Stephanik
<[email protected]> wrote:
> I have a question on how to perfrom a specific task in VPython. I hope I'm
> asking the right list.
>
> I'm trying to get the visual.graph module to be able to dynamically update a
> curve. For example, I'd like to graph a function f(x) + c, where c is able
> to be manipulated by the user, perhaps via a slider control. I can't seem to
> get VPython to *change* a graph, only to draw new ones (it seems histograms
> are able to do this, but not the other plot types?). And the gcurve object
> doesn't seem to respond to setting .visible=False, thus allowing me to
> create a new one and re-draw.
>
> Thanks for considering,
>
> Brian
>
>
> Brian Stephanik
> Graduate Student
> Department of Physics
> University of Washington
> [email protected]

------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_nov