1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
|
gp = popen(GNUPLOT_PATH,"w");
if(gp == NULL){
fprintf(stderr, "Oops, I cant find %s.", GNUPLOT_PATH);
exit(EXIT_FAILURE);
}
fprintf(gp,"reset \n");
fprintf(gp,"set term windows \n");
fflush(gp);
fprintf(gp,"set grid x y \n");
fflush(gp);
fprintf(gp,"set title \"Répartition des nombres générés par le pnrg r250 pour %d de tirages\" tc lt 0 \n",max_generation);
fflush(gp);
// fprintf(gp,"set xlabel \'Ensemble\' tc lt 0 \n");
// fflush(gp);
fprintf(gp,"set ylabel \'Nombre de tirages \' tc lt 0 \n");
fflush(gp);
fprintf(gp,"set xr [0:1]\n");
fflush(gp);
fprintf(gp,"set yr [0:%d]\n",(int)(1.2*max_generation/nbr_case));
fflush(gp);
fprintf(gp,"set xtics\n");
fflush(gp);
fprintf(gp,"set ytics\n");
fflush(gp);
fprintf(gp,"plot \'%s\' u 1:2 title \" \" with boxes fs solid 0.7\n",fp1);
fflush(gp);
fprintf(gp,"set nokey \n");
fflush(gp);
fprintf(gp,"set label \"{/Symbol c}^2 = %f\" tc lt 16 at 0.1,%d \n",chi_2,(int)(1.1*max_generation/nbr_case));
fflush(gp);
fprintf(gp,"set label \"dl = %d\" tc lt 16 at 0.4,%d \n",
(int)(nbr_case-1),(int)(1.1*max_generation/nbr_case));
fflush(gp);
fprintf(gp,"set label \"{/Symbol c}^{2}_{crit}(%d,%1.2f)= %3.3f\" at 0.65,%d\n",
(int)(nbr_case-1.),0.05,123.54,
(int)(1.1*max_generation/nbr_case));
fflush(gp);
fprintf(gp,"set encoding iso_8859_1 \n");
fflush(gp);
fprintf(gp,"set term post eps landscape enhan mono \"Times-Roman\" 18 \n");
fflush(gp);
fprintf(gp,"set output \"%s.eps\" \n",fp2);
fflush(gp);
fprintf(gp,"replot\n");
fflush(gp);
getchar();
fprintf(gp,"reset\n");
fflush(gp);
fclose(gp); |
Partager