|
From: Jouke W. <j.w...@gm...> - 2015-01-10 12:27:57
|
On Wed, Jan 7, 2015 at 2:02 AM, Ethan A Merritt <sf...@us...> wrote: > On Saturday, 03 January, 2015 12:39:14 Jouke Witteveen wrote: > >> The x-value of individual boxplots is ignored when placing tics for > >> multiple boxplots. > >> > >> This patch fixes that issue. > > [snip] > > > > Bug tracker item: https://sourceforge.net/p/gnuplot/bugs/1532/ > > > > Example problem case adapted from the Bug Tracker > > (Example uses only a single point per boxplot) > > > > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% > > $DATA << EOD > > 2 1 > > 3 2 > > 5 3 > > EOD > > > > set style boxplot separation 0 > > plot 'data' using 1:2:(0):(strcol(1)) with boxplot > > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% > > > > There is a conflict between applying the first using spec (column 1) > > as a coordinate and applying the style parameter "separation". > > > > Currently the numeric column 1 values win for placing the > > boxplots themselves (a single point each in the example). > > So there are plots at x=2, x=3, and x=5. > > > > But the separation spec wins for placing the labels, > > which means the numeric values in column 1 are ignored and > > their string representations all placed as labels at x=2. > > > > Documentation: > > "The first and third columns (x coordinate and width) are normally > > provided as constants rather than as data columns." > > > > Question: > > Is it ever correct to provide a non-constant x coordinate as > > in the example? How would the program deal with a mismatch > > between the x-coordinate (column 1) and the "discrete levels of > > of factor variable" in column 4? That can't happen in the > > example above because the same data column is used for both > > but that wouldn't normally be true. > > > > In other words - is this really a bug? > There is a possible mismatch between the factor level (column 4) and the width (column 3) too. The situation is far from pretty, but the proposed patch in the bugreport adds to the usability without breaking compatibility. What are the gnuplot conventions regarding interface breakage? I'd say a cleaner interface for boxplots would be a using spec where the first column is the x-coordinate and the second the y-coordinate. Grouping then takes place based on the x-coordinate and labeling can be implemented via an additional xticlabels column, as is used in other plot types already. The width still needs a solution. We could go with a third column in the using spec, as is currently done, or with a user specified function which takes an x coordinate as input and yields a width. The latter approach would lead to unambiguous widths. These are just some thoughts, nothing more. Regards, - Jouke |