I m writing a function to plot a histogram but I m stuck with a problem. This is the code
void plotHist(int num, regression *r, histData *h)
{
int i, j;
for (i = 0; i< h->numHist; i++)
{
printf("%2f |", h->hist[i].xValue) ;
for ( j = 0 ; j < h->hist[i].yFrequency/5; j ++)
{
printf("*");
}
printf("
");
}
}
我接受筛选的结果是:
-199.422 |
-142.232 |****
-98.232 |******
-21.32 |***********
43.424 |****************
58.234 |***************
92.123 |*********
189.5 |****
The problem is that I have to add another array to this histogram by "o" letters which I don t know how to do. The result should be like this:
-199.422 | o
-142.232 |****o
-98.232 |******o
-21.32 |********o**
43.424 |**********o*****
58.234 |********o******
92.123 |******o**
189.5 |****o