Changeset 1f79936
- Timestamp:
- 11/16/18 10:07:49 (2 years ago)
- Branches:
- develop
- Children:
- 36fb135
- Parents:
- d334782
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
examples/tutorial/ipdist-parallel.c
rd334782 r1f79936 66 66 uint64_t tickrate; 67 67 68 char *stats_outputdir = " ";68 char *stats_outputdir = "/home/jcv9/output-spectre/"; 69 69 /* Calculate and plot the percentage change from the previous plot */ 70 70 int stats_percentage_change = 0; … … 490 490 if(tally->output_count == 0) { 491 491 tmp = fopen(outputfile2, "w"); 492 fprintf(tmp, " prefix\t");492 fprintf(tmp, "timestamp\t"); 493 493 for(i=0;i<256;i++) { 494 494 fprintf(tmp, "%d\t", i); … … 510 510 } 511 511 } 512 513 514 /* Get the version of gnuplot */ 515 //char delim[] = " "; 516 //char gnuplot_result[256]; 517 //double gnuplot_version = 0; 518 //FILE *gnuplot = popen("gnuplot --version", "r"); 519 //fgets(gnuplot_result, sizeof(gnuplot_result)-1, gnuplot); 520 //strtok(gnuplot_result, delim); 521 //gnuplot_version = atof(strtok(NULL, delim)); 522 //pclose(gnuplot); 512 523 513 524 /* Plot the results */ … … 552 563 fprintf(gnuplot, "set xlabel 'Rank'\n"); 553 564 fprintf(gnuplot, "set ylabel 'Frequency'\n"); 565 fprintf(gnuplot, "set logscale xy 10\n"); 554 566 fprintf(gnuplot, "set xrange[1:255]\n"); 555 fprintf(gnuplot, "set logscale xy 10\n");567 fprintf(gnuplot, "set xtics 0,10,255\n"); 556 568 /* Plot the second graph of the multiplot */ 557 569 fprintf(gnuplot, "plot '%s' using 2:%d index 0 title 'Source octet %d',", outputfile, (i*4)+4, i+1); 558 570 fprintf(gnuplot, "'%s' using 2:%d index 0 title 'Destination octet %d'\n", outputfile, (i*4)+6, i+1); 559 fprintf(gnuplot, " replot");571 fprintf(gnuplot, "unset multiplot\n"); 560 572 pclose(gnuplot); 561 573 } … … 574 586 fprintf(gnuplot, "set output '%s'\n", outputplot2); 575 587 if(k) { 576 fprintf(gnuplot, "set title 'Timeseries Dst Octet %i '\n", i+1);588 fprintf(gnuplot, "set title 'Timeseries Dst Octet %i - Cumulative'\n", i+1); 577 589 } else { 578 fprintf(gnuplot, "set title 'Timeseries Src Octet %i '\n", i+1);590 fprintf(gnuplot, "set title 'Timeseries Src Octet %i - Cumulative'\n", i+1); 579 591 } 580 592 fprintf(gnuplot, "set xtics rotate\n"); 581 fprintf(gnuplot, "set key out vert\n");582 fprintf(gnuplot, "set key right\n");593 //fprintf(gnuplot, "set key out vert\n"); 594 fprintf(gnuplot, "set key off\n"); 583 595 //fprintf(gnuplot, "set xdata time\n"); 584 596 //fprintf(gnuplot, "set timefmt '%%s'\n"); … … 586 598 fprintf(gnuplot, "set autoscale xy\n"); 587 599 if(k) { 588 fprintf(gnuplot, "plot '%sipdist-timeseries-dst-octet%d.data' using 2:xtic(1) with lines title columnheader(2), for[i=3:257] '' using i with lines title columnheader(i)\n", stats_outputdir, i+1); 600 //if(gnuplot_version < 5) { 601 fprintf(gnuplot, "plot '%sipdist-timeseries-dst-octet%d.data' using 2:xtic(1) with lines title columnheader(2) smooth cumulative, for[i=3:257] '' using i with lines title columnheader(i) smooth cumulative\n", stats_outputdir, i+1); 602 //} else { 603 // fprintf(gnuplot, "plot '%sipdist-timeseries-dst-octet%d.data' using 2:xtic(1) with lines title columnheader(2) at end smooth cumulative, for[i=3:257] '' using i with lines title columnheader(i) at end smooth cumulative\n", stats_outputdir, i+1); 604 //} 589 605 } else { 590 fprintf(gnuplot, "plot '%sipdist-timeseries-src-octet%d.data' using 2:xtic(1) with lines title columnheader(2), for[i=3:257] '' using i with lines title columnheader(i)\n", stats_outputdir, i+1); 606 //if(gnuplot_version < 5) { 607 fprintf(gnuplot, "plot '%sipdist-timeseries-src-octet%d.data' using 2:xtic(1) with lines title columnheader(2) smooth cumulative, for[i=3:257] '' using i with lines title columnheader(i) smooth cumulative\n", stats_outputdir, i+1); 608 //} else { 609 // fprintf(gnuplot, "plot '%sipdist-timeseries-src-octet%d.data' using 2:xtic(1) with lines title columnheader(2) at end smooth cumulative, for[i=3:257] '' using i with lines title columnheader(i) at end smooth cumulative\n", stats_outputdir, i+1); 610 //} 591 611 } 592 612 fprintf(gnuplot, "replot");
Note: See TracChangeset
for help on using the changeset viewer.