pspp-cvs
[Top][All Lists]
Advanced

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

[Pspp-cvs] Changes to pspp/src/plot-hist.c


From: John Darrington
Subject: [Pspp-cvs] Changes to pspp/src/plot-hist.c
Date: Sat, 07 May 2005 20:13:21 -0400

Index: pspp/src/plot-hist.c
diff -u pspp/src/plot-hist.c:1.4 pspp/src/plot-hist.c:1.5
--- pspp/src/plot-hist.c:1.4    Fri Apr 29 01:02:15 2005
+++ pspp/src/plot-hist.c        Sun May  8 00:13:19 2005
@@ -65,43 +65,46 @@
 static void
 hist_draw_bar(struct chart *ch, const gsl_histogram *hist, int bar)
 {
-  double upper;
-  double lower;
-  double height;
-
   if ( !ch ) 
-         return ;
-  const size_t bins = gsl_histogram_bins(hist);
-  const double x_pos = (ch->data_right - ch->data_left) * bar / (double) bins ;
-  const double width = (ch->data_right - ch->data_left) / (double) bins ;
+    return ;
 
 
-  assert ( 0 == gsl_histogram_get_range(hist, bar, &lower, &upper));
+  {
+    double upper;
+    double lower;
+    double height;
 
-  assert( upper >= lower);
+    const size_t bins = gsl_histogram_bins(hist);
+    const double x_pos = (ch->data_right - ch->data_left) * bar / (double) 
bins ;
+    const double width = (ch->data_right - ch->data_left) / (double) bins ;
 
-  height = gsl_histogram_get(hist, bar) * 
-    (ch->data_top - ch->data_bottom) / gsl_histogram_max_val(hist);
 
-  pl_savestate_r(ch->lp);
-  pl_move_r(ch->lp,ch->data_left, ch->data_bottom);
-  pl_fillcolorname_r(ch->lp, ch->fill_colour); 
-  pl_filltype_r(ch->lp,1);
+    assert ( 0 == gsl_histogram_get_range(hist, bar, &lower, &upper));
 
+    assert( upper >= lower);
 
-  pl_fboxrel_r(ch->lp,
-              x_pos, 0,
-              x_pos + width, height);
+    height = gsl_histogram_get(hist, bar) * 
+      (ch->data_top - ch->data_bottom) / gsl_histogram_max_val(hist);
 
-  pl_restorestate_r(ch->lp);
+    pl_savestate_r(ch->lp);
+    pl_move_r(ch->lp,ch->data_left, ch->data_bottom);
+    pl_fillcolorname_r(ch->lp, ch->fill_colour); 
+    pl_filltype_r(ch->lp,1);
 
-  {
-  char buf[5];
-  snprintf(buf,5,"%g",(upper + lower) / 2.0);
-  draw_tick(ch, TICK_ABSCISSA,
-           x_pos + width / 2.0, buf);
-  }
 
+    pl_fboxrel_r(ch->lp,
+                x_pos, 0,
+                x_pos + width, height);
+
+    pl_restorestate_r(ch->lp);
+
+    {
+      char buf[5];
+      snprintf(buf,5,"%g",(upper + lower) / 2.0);
+      draw_tick(ch, TICK_ABSCISSA,
+               x_pos + width / 2.0, buf);
+    }
+  }
 }
 
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]