[goffice] Fix histograms with missing values. [#763446]



commit cdda934f7f195f6fbc0fe4ba38fe51cd49391eb0
Author: Jean Brefort <jean brefort normalesup org>
Date:   Thu Mar 10 12:22:38 2016 +0100

    Fix histograms with missing values. [#763446]

 ChangeLog                            |    6 ++++++
 NEWS                                 |    6 +++---
 plugins/plot_distrib/gog-histogram.c |    4 ++++
 3 files changed, 13 insertions(+), 3 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index f45226f..3109cc2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2016-03-10  Jean Brefort  <jean brefort normalesup org>
+
+       * plugins/plot_distrib/gog-histogram.c
+       (gog_histogram_plot_series_update): don't take nans and infinite into
+       account when evaluating automatic bins. [#763446]
+
 2016-03-09  Morten Welinder  <terra gnome org>
 
        * tests/constants.c (print_bits): Fix bit pattern rounding past
diff --git a/NEWS b/NEWS
index b710a6e..080fe99 100644
--- a/NEWS
+++ b/NEWS
@@ -1,11 +1,11 @@
 goffice 0.10.28:
 
+Jean:
+       * Fix histograms with missing values. [#763446]
+
 Morten:
        * Configuration fixes.
        * Introspection improvements.
-       * Improve go_complex_sqrt.
-       * Improve go_complex_tan.
-       * Improve go_complex_ln.
 
 --------------------------------------------------------------------------
 goffice 0.10.27:
diff --git a/plugins/plot_distrib/gog-histogram.c b/plugins/plot_distrib/gog-histogram.c
index 6d4a8ea..9f505f4 100644
--- a/plugins/plot_distrib/gog-histogram.c
+++ b/plugins/plot_distrib/gog-histogram.c
@@ -975,9 +975,13 @@ gog_histogram_plot_series_update (GogObject *obj)
                double *y = NULL, *y_ = NULL;
                if (y_vals) {
                        y = go_range_sort (y_vals, y_len);
+                       while (y_len > 0 && !go_finite (y[y_len-1]))
+                               y_len--;
                }
                if (y__vals) {
                        y_ = go_range_sort (y__vals, y__len);
+                       while (y__len > 0 && !go_finite (y_[y__len-1]))
+                               y__len--;
                }
                if (!x_vals || x_len <= 1) {
                        /* guess reasonable values */


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]