~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

Linux Cross Reference
Tina4/src/draw/plot/graph_hfit.c

Version: ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 #include <stdio.h>
  2 #include <tina/sys.h>
  3 #include <tina/sysfuncs.h>
  4 #include <tina/math.h>
  5 #include <tina/mathfuncs.h>
  6 #include <tina/tv.h>
  7 #include <tina/tvfuncs.h>
  8 #include <tina/draw.h>
  9 #include <tina/hist_funcs.h>
 10 
 11 void  graph_hfit(Tv *tv, shistogram * hist)
 12 {
 13     int i;
 14     float *xdata, *ydata, *zdata;
 15  
 16     if (tv==NULL||tv->tv_screen==NULL) return;
 17     xdata = fvector_alloc(0, 2*hist->xbins);
 18     ydata = fvector_alloc(0, 2*hist->xbins);
 19     zdata = fvector_alloc(0, 2*hist->xbins);
 20  
 21     for (i=0;i<hist->xbins;i++)
 22     {
 23        xdata[2*i] =  (float)(i+0.0001)*hist->xincr+hist->xmin;
 24        xdata[2*i+1] =  (float)(i+1.0001)*hist->xincr+hist->xmin;
 25        ydata[2*i] =  hfill1(hist,xdata[2*i],0.0);
 26        ydata[2*i+1] =  hfill1(hist,xdata[2*i],0.0);
 27        if (hist->super!=NULL)
 28        {
 29           zdata[2*i] =  hist->super(hist->npar,hist->par,xdata[2*i]);
 30           zdata[2*i+1] =  hist->super(hist->npar,hist->par,xdata[2*i+1]);
 31        }
 32     }
 33      tv_erase(tv);
 34      plot(PL_INIT, PL_TV, tv,
 35           PL_AXIS_COLOR, black,
 36           PL_TITLE, "Histogram Fit",
 37           PL_COLOR, red,
 38           PL_GRAPH_DATA, 2*hist->xbins, xdata, ydata,
 39           PL_COLOR, blue,
 40           PL_GRAPH_DATA, 2*hist->xbins, xdata, zdata,
 41           PL_PLOT,
 42           NULL);
 43     fvector_free((void *)xdata,0);
 44     fvector_free((void *)ydata,0);
 45     fvector_free((void *)zdata,0);
 46 }
 47 
 48 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

This page was automatically generated by the LXR engine.
Visit the LXR main site for more information.