gramm icon indicating copy to clipboard operation
gramm copied to clipboard

Error Plotting Outliers with stat_boxplot 2.0

Open jostro42 opened this issue 2 years ago • 1 comments

I ran into a similar problem that was reported in issue #86.

Error using horzcat
Dimensions of arrays being concatenated are not consistent.

Error in gramm/stat_boxplot>my_boxplot (line 81)
        outliersy=[outliersy ysel(sel_outlier)'];

Error in gramm/stat_boxplot>@(dobj,dd)my_boxplot(dobj,dd,p.Results) (line 24)
obj.geom=vertcat(obj.geom,{@(dobj,dd)my_boxplot(dobj,dd,p.Results)});

Error in gramm/draw (line 548)
                                        obj.geom{geom_ind}(obj,draw_data);

I could resolve this issue by changing line 81 in stat_boxplot.m to outliersy=[outliersy ysel(sel_outlier)];

It seems that this problem does not arise if there are outliers in only one condition of the data, so I was able to successfully plot data with a different y variable. But as soon as there are outliers in both conditions, the error occurs.

My data has this format:

Yvar  fac1 fac2
val1  a      c
val2  a      d
val3  b      c
val4  b      d

I am not sure whether removing the apostrophe might cause different errors down the line, however.

I hope this helps somehow!

jostro42 avatar Apr 06 '22 10:04 jostro42