Placing canvases and graphs side by side

25 views
Skip to first unread message

Bruce Sherwood

unread,
May 15, 2016, 4:28:17 PM5/15/16
to Glowscript Users
The following program forces a canvas (the default canvas, named "scene") to the left in the window, and forces a graph (named "plotting") to the right in the window, so that the graph appears to the right of the 3D canvas. If the window is too narrow to place them side by side, the graph will appear below the canvas.

GlowScript 2.1 VPython
scene.align = 'left'
plotting = graph(width=400, height=400, align='right')

scene.title = "Make window wide to place the two views side by side."
scene.width = 400
box()

g = gcurve()
g.plot(1,2)
g.plot(5,-3)
Reply all
Reply to author
Forward
0 new messages