chart: Fix format string issues in chart_write_title callers.
[pspp] / src / language / stats / examine.q
index a829112ef2e45366034dc93da16b0cedb4b5372c..f3fec17b9047af5b0f16b08eee28ffede82ec2b7 100644 (file)
@@ -448,15 +448,18 @@ show_histogram (const struct variable **dependent_var,
          struct string str;
          const struct factor_result *result =
            ll_data (ll, struct factor_result, ll);
+          double mean, var, n;
 
          ds_init_empty (&str);
          ds_put_format (&str, "%s ", var_get_name (dependent_var[v]));
 
          factor_to_string (fctr, result, &str);
 
+          moments1_calculate ((struct moments1 *) result->metrics[v].moments,
+                              &n, &mean, &var, NULL,  NULL);
          histogram_plot ((struct histogram *) result->metrics[v].histogram,
                          ds_cstr (&str),
-                         (struct moments1 *) result->metrics[v].moments);
+                         n, mean, sqrt (var), false);
 
          ds_destroy (&str);
        }
@@ -606,7 +609,7 @@ show_boxplot_variables (const struct variable **dependent_var,
       var_append_value_name (fctr->indep_var[0], &result->value[0], &title);
 #endif
 
-      chart_write_title (ch, ds_cstr (&title));
+      chart_write_title (ch, "%s", ds_cstr (&title));
       ds_destroy (&title);
 
       for (v = 0; v < n_dep_var; ++v)
@@ -1245,7 +1248,7 @@ show_summary (const struct variable **dependent_var, int n_dep_var,
   tbl = tab_create (n_cols, n_rows, 0);
   tab_headers (tbl, heading_columns, 0, heading_rows, 0);
 
-  tab_dim (tbl, tab_natural_dimensions, NULL);
+  tab_dim (tbl, tab_natural_dimensions, NULL, NULL);
 
   /* Outline the box */
   tab_box (tbl,
@@ -1482,7 +1485,7 @@ show_descriptives (const struct variable **dependent_var,
   tbl = tab_create (n_cols, n_rows, 0);
   tab_headers (tbl, heading_columns, 0, heading_rows, 0);
 
-  tab_dim (tbl, tab_natural_dimensions, NULL);
+  tab_dim (tbl, tab_natural_dimensions, NULL, NULL);
 
   /* Outline the box */
   tab_box (tbl,
@@ -1795,7 +1798,7 @@ show_extremes (const struct variable **dependent_var,
   tbl = tab_create (n_cols, n_rows, 0);
   tab_headers (tbl, heading_columns, 0, heading_rows, 0);
 
-  tab_dim (tbl, tab_natural_dimensions, NULL);
+  tab_dim (tbl, tab_natural_dimensions, NULL, NULL);
 
   /* Outline the box */
   tab_box (tbl,
@@ -2000,7 +2003,7 @@ show_percentiles (const struct variable **dependent_var,
   tbl = tab_create (n_cols, n_rows, 0);
   tab_headers (tbl, heading_columns, 0, heading_rows, 0);
 
-  tab_dim (tbl, tab_natural_dimensions, NULL);
+  tab_dim (tbl, tab_natural_dimensions, NULL, NULL);
 
   /* Outline the box */
   tab_box (tbl,