My example is too complicated and uses my own verb to compute the histogram buckets based on frequencies. When I try to simplify the example, it makes me think that the problem I'm seeing is introduced by my own code - it's some kind of "off-by-one" error.
The simple example I came up with to illustrate the problem is this: 'hist;xlabel 0 1 2 3 4 5' plot i.5 but this mis-match between the labels and the data items is a specification mis-match: there are six labels but only five data items. Anyway, this looks like the problem I'm seeing, so the underlying cause is probably the same. I think I probably define n+1 buckets for n data items. On Mon, Feb 9, 2015 at 8:53 AM, Brian Schott <[email protected]> wrote: > Devon, > > The line of code in getaxis1 produces a list of *formatted* digits. In your > case some of the digits are built of characters of length 1 and some are of > length 2. Could that be the problem, and could the format be adjusted to > fix that? I cannot find the plot command in your example to investigate > myself. > > > On Sun, Feb 8, 2015 at 3:45 PM, Devon McCormick <[email protected]> > wrote: > > > I'll see if this helps a long-standing problem of "bar-creep" that I've > had > > with histograms for quite some time - see > > > > > http://www.jsoftware.com/jwiki/NYCJUG/2013-07-09?highlight=%287-27%29#Quickly_Building_a_Simple_Simulation > > for an example. The bars should line up with integral intervals but do > so > > only in the center of the chart. > > > > On Sun, Feb 8, 2015 at 11:10 AM, Brian Schott <[email protected]> > > wrote: > > > > > Another possible way to do this for your example is to change the verb > > > getaxis1 in the script j64-803/addons/graphics/plot/jzplot.ijs so that > > the > > > first line below is replaced with the second line below (on about the > > 42nd > > > line). This fix only applies to 'type bar' as far as I know. > > > > > > > > > Label=. ": each >:i.steps > > > Label=. <@":"0{.>{."1 Data > > > > > > -- > (B=) > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm > -- Devon McCormick, CFA ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
