How to place several scenes or Graphs in to grid?

32 views
Skip to first unread message

ZYuan X

unread,
Dec 30, 2017, 10:02:09 AM12/30/17
to VPython-users
How to place several scenes or Graphs in to grid?
I mean scenes (or graphs) are arranged to rows and columns.
Right now, it seems that all scenes (or graphs) are just in one column (using VPython7).

Bruce Sherwood

unread,
Dec 30, 2017, 10:12:34 AM12/30/17
to VPython-users
There is a limited capability in this respect, namely putting a scene or graph beside a scene or graph:

scene.align = 'left'
box()
canvas(align='right')
sphere()

ZYuan X

unread,
Dec 30, 2017, 10:14:49 AM12/30/17
to VPython-users
Does that mean the maximum number of columns is 2 (left and right)?

ZYuan X

unread,
Dec 30, 2017, 10:30:05 AM12/30/17
to VPython-users

By the way, I find that in VPython6  widgets can be conveniently arranged in a window (as shown bellow, downed from vpython6 introduction).  

But as we known that VPython7 graphics display is shown in a browser tab rather than in a bare window. 

So can I say that VPython7 is less convenient than VPython6 in this regard?




On Saturday, December 30, 2017 at 11:12:34 PM UTC+8, Bruce Sherwood wrote:

Bruce Sherwood

unread,
Dec 30, 2017, 10:52:44 AM12/30/17
to VPython-users
As far as columns are concerned, yes, there are only two columns for canvases and graphs, but widgets can be placed side by side, as seen in this example (this is a link to GlowScript VPython, but of course the program also runs in VPython 7):


VPython 7 has less developed layout capabilities than VPython 6, though here is a fairly sophisticated example that is comparable to the example you cited:


I would claim that the VPython 7 widgets are easier to use than the wxPython widgets.

Bruce

Daniel Schroeder

unread,
Dec 31, 2017, 9:41:00 AM12/31/17
to VPython-users
That fields example is neat in a lot of ways! So I guess align="left" puts the caption to the right by design. I've started a new topic to show how to keep the caption underneath when there's a graph on the right.

Bruce Sherwood

unread,
Dec 31, 2017, 10:56:54 AM12/31/17
to VPython-users
To add to what I commented on your other note on the topic: As can be seen in the fields program, there clearly are advantages to placing the caption to the right of a canvas in situations where there is just one canvas (and no graph). It's great that you also found a way to keep the caption under the canvas when displaying a graph on the right.

Bruce

Reply all
Reply to author
Forward
0 new messages