X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Foutput%2Fcharts%2Fspreadlevel-plot.c;h=e4fed6178666fdfe4fbe9fc161d697fc50c17d65;hb=b315faf626c929de36b04df0848b93b0014e2d35;hp=d5b6e3d01a33aa483f6968fd9493a9fffca30a2a;hpb=64ad089c50c954e9130448f1becfab0f6aff6a9b;p=pspp diff --git a/src/output/charts/spreadlevel-plot.c b/src/output/charts/spreadlevel-plot.c index d5b6e3d01a..e4fed61786 100644 --- a/src/output/charts/spreadlevel-plot.c +++ b/src/output/charts/spreadlevel-plot.c @@ -1,5 +1,5 @@ /* PSPP - a program for statistical analysis. - Copyright (C) 2012 Free Software Foundation, Inc. + Copyright (C) 2012, 2020 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -44,19 +44,20 @@ spreadlevel_plot_create (const char *label, double tx_pwr) sl->n_data = 0; sl->data = NULL; - + return &sl->chart_item; } -void +void spreadlevel_plot_add (struct chart_item *ci, double spread, double level) { struct spreadlevel_plot_chart *sl = to_spreadlevel_plot_chart (ci); - if ( sl->tx_pwr == 0) + /* Zero has a special meaning, in this implementation. */ + if (sl->tx_pwr == 0) { - spread = log (spread); - level = log (level); + spread = log (fabs (spread)); + level = log (fabs (level)); } else {