Menu

#2268 Disabled boxplot outliers still autoscale plot yaxis

None
closed-fixed
nobody
v5.4 (25)
2021-04-13
2020-05-28
lindnerb
No

Using the following script:

reset
$DATA << EOD
1
2
1
3
2
2
3
1
3
3
2
100
4
3
3
EOD

set autoscale x
set autoscale y
set style boxplot nooutliers
plot $DATA with boxplot

The plot autoscales in y from 0 to 100, although the outlier at y=100 should be ignored because of "nooutliers". Quoting the documentation under keyword "boxplot": 'If outliers are not drawn they do not contribute to autoscaling'.

Tested on windows with both gp528-win64-mingw.7z as well as a build from current 5.5p0 branch (2020-05-03), both wxt and win terminal.

Discussion

  • Ethan Merritt

    Ethan Merritt - 2020-05-28

    Fixed in the upstream source and can be tested in the version 5.4 -rc1 pre-release package

     
  • Ethan Merritt

    Ethan Merritt - 2020-05-28
    • status: open --> pending-fixed
    • Group: -->
    • Priority: -->
     
  • lindnerb

    lindnerb - 2020-05-28

    Thanks for the hint of the 5.4-rc1 release.
    Tested with gp54rc1-win64-mingw.7z, but the bug is still present.
    Same happens with a recent build from the master branch.
    I see that there is a commit dated 2019-05-17 "when boxplot outliers are not drawn they should not affect autoscaling". But apparently it still does not work. Hence this ticket.
    See the attached screenshot.
    Am I doing something wrong?

     
  • Ethan Merritt

    Ethan Merritt - 2020-05-28
    • status: pending-fixed --> open
     
  • Ethan Merritt

    Ethan Merritt - 2020-05-28

    My apologies. I see you are correct that your test case exposes a problem. I was assuming that the previous fix took care of it and failed to test the example you provided.

     
  • Ethan Merritt

    Ethan Merritt - 2020-05-29
    • status: open --> pending-fixed
     
  • Ethan Merritt

    Ethan Merritt - 2020-05-29

    Fixed now. Somehow lines were lost from the previous fix. The mechanism to fix it was there, but it wasn't actually called when needed.
    will be in 5.4 -rc2

     
  • Ethan Merritt

    Ethan Merritt - 2020-07-16
    • Labels: --> v5.4
    • Status: pending-fixed --> closed-fixed
     
  • corngood

    corngood - 2021-04-13

    Unfortunately this broke autoscaling of the x-axis when outliers are enabled, for example:

    reset
    $DATA << EOD
    4
    3
    3
    EOD
    
    set autoscale x
    set autoscale y
    plot $DATA with boxplot
    

    Will result in 'x range is invalid'.

    This is a WIP fix I'm testing:

    diff --git a/src/plot2d.c b/src/plot2d.c
    index aaf4604b8..3208ee7dd 100644
    --- a/src/plot2d.c
    +++ b/src/plot2d.c
    @@ -1620,11 +1620,10 @@ boxplot_range_fiddling(struct curve_points *plot)
         /* If outliers were processed, that has taken care of autoscaling on y.
    
          * If not, we need to calculate the whisker bar ends to determine yrange.
          */
    -    if (boxplot_opts.outliers)
    -   restore_autoscaled_ranges(&axis_array[plot->x_axis], NULL);
    -    else
    +    if (!boxplot_opts.outliers) {
        restore_autoscaled_ranges(&axis_array[plot->x_axis], &axis_array[plot->y_axis]);
    -    autoscale_boxplot(plot);
    +        autoscale_boxplot(plot);
    +    }
    
         extra_width = plot->points[0].xhigh - plot->points[0].xlow;
         if (extra_width == 0)
    
     

    Last edit: corngood 2021-04-14

Log in to post a comment.

Auth0 Logo