From 02c21d56cb61f8c56117e21dc8540183a53395e3 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Thu, 28 Jul 2011 14:39:52 +0200 Subject: Improve partiality graph (sort of) --- src/scaling-report.c | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) (limited to 'src/scaling-report.c') diff --git a/src/scaling-report.c b/src/scaling-report.c index 441353b7..0f395229 100644 --- a/src/scaling-report.c +++ b/src/scaling-report.c @@ -170,6 +170,8 @@ static void partiality_graph(cairo_t *cr, const struct image *images, int n, double totals[nbins]; int counts[nbins]; double prob; + double pcalcmin[nbins]; + double pcalcmax[nbins]; show_text_simple(cr, "Observed partiality", -20.0, g_height/2.0, NULL, -M_PI_2, J_CENTER); @@ -186,7 +188,10 @@ static void partiality_graph(cairo_t *cr, const struct image *images, int n, for ( i=0; i= pcalcmin[bin]) + && (pcalc < pcalcmax[bin]) ) + { + totals[bin] += pobs; + counts[bin]++; + } + } + bin = nbins * pcalc; - totals[bin] += pobs; - counts[bin]++; if ( random_flat(1.0) < prob ) { plot_point(cr, g_width, g_height, pcalc, pobs); @@ -236,8 +251,11 @@ static void partiality_graph(cairo_t *cr, const struct image *images, int n, cairo_new_path(cr); cairo_move_to(cr, 0.0, g_height); for ( i=0; i