Some of you may have invoked visual.graph to plot 2D graphs of functions
and data with autoscaling. Our own physics students have been using it all
this semester, mainly with gcurve (which draws lines between the data
points). This week for the first time they used the vertical-bar option,
and we found that the names of some of the graphics objects in the package
should probably be changed, as proposed here:
gvbar -> gvbars (or possibly gvbargraph)
ghbar -> ghbars (or possibly ghbargraph)
gdot -> gdots (or possibly gdotgraph or gscatter)
The way these are used is shown in the following example:
mybars = gvbar(color=color.red, delta=0.3)
for x in range(100):
mybars.plot(pos=(x,y))
The mild problem we encountered was with the name in the singular (gvbar),
there was a tendency to think it makes just one vertical bar, so students
put both the gvbar constructor and the plot option in the loop, which is
inefficient. It seems plausible that using a plural name (gvbars) or a name
such as gvbargraph the intent would be clearer. I prefer the shorter
version gvbars to gvbargraph.
Any comments? I'd like to make this change right away in the context of
making a major release of VPython that is compatible with Python 2.0 and
which has much improved documentation for Visual. I don't imagine that
there are very many programs in existence that use gvbar.
Bruce Sherwood
|