From: Bruce S. <ba...@an...> - 2002-01-11 02:29:35
|
Many thanks for this detailed report! It turns out that there were several different things wrong with the ghistogram machinery in the graph module, which are now fixed in graph.py in the zip file Visual-2002-01-10.zip at vpython.org, and also incorporated into the VPython installer for Python 2.2. With the fixes, the following routine plots correctly: from visual.graph import * agelist1 = [-5, 37, -12, 21, -8, 63, 52, 75, -7] ages = ghistogram(bins=arange(-20, 80, 20), color=color.red, delta=5) ages.plot(data=agelist1) # plot the age distribution Note too the use of delta to specify the width of the bar, a feature not previously mentioned in the documentation. Bruce Sherwood --On Thursday, January 10, 2002 20:29 +0000 Do...@ao... wrote: > I have been running into some problems with the ghistogram routine. I > have some data, which includes negative and positive values. When I set > the bins and xmin, xmax to allow for this, the distribution ends up > piled up on the xmax side of the plot. If I offset the data to be just > positive, it works, but the plot is not as clear. Did I miss something > and this feature only allows for positive values? |