From: Marko V. <ma...@io...> - 2004-04-26 20:29:38
|
Thanks, the bug is fixed, indeed :). > For 0.7 I'm working to allow several styles within one plot command. > I want to allow errorbars at bar graphs without further thoughts: > > g.plot(graph.data.list(xname=1, y=2, dy=3), [graph.style.bar(), graph.style.errorbar()]) I guess it should be g.plot(graph.data.list(xname=1, y=2, dy=3), [graph.style.bar(), graph.style.symbol()]) ? > I also want to enable insertion of text at the top (or another > position) of a bar graph and others. Another gain will be an easier > extention of existing styles without copying much code as it currently > can be, because graph styles are still quite monolithic. So you have > to wait for another two or three months. (Beside that I could explain > you the bar dist etc. when you ask questions about it ...) Excellent plan! OK, I'll ask about positioning of the bars (to draw bars with errors during 2-3 month). It seems that, in the simplest case, centers of the bars are at positions 1, 2, 3, ... and the limits of the axis are min=0.5 to max=N+0.5 (N is the number of bars). Situation is somewhat more difficult if there are multiple bars per each category (as in the second plot of examples/bar.py). For example, if we have NSubCols in each of the groups of bars, then the center of each of the subbars is at x = j + 1 + (i - NSubCols/2.0 + 0.5)*w where j is index of the group (from 0 to N-1), i is the index of the subbar, and w is the width of the subbar. The width of the subbar is determined by NSubCols and argument dist given to axis.bar() as follows: w = 1.0 / (NSubCols + dist) However, these formula work only in the case if dist for multisubaxis is set equal to zero. How should I modify these formula to get them work on general case (with the both dist given for axis and multisubaxis)? Best wishes, Marko |