Skip to content

Commit

Permalink
- Removed vertical grid lines
Browse files Browse the repository at this point in the history
- Fixed plotting errors when only one element is present

Change-Id: I3cad9e2027e670576b90ce0d465fa92781eeaa7c
Signed-off-by: panacotta <[email protected]>
  • Loading branch information
alejoar committed Jul 31, 2014
1 parent 2dc2ca2 commit c807fa5
Showing 1 changed file with 22 additions and 13 deletions.
35 changes: 22 additions & 13 deletions papiplot/src/plot.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ void printhelp(char** argv){
"\tsudo apt-get install gnuplot\n\n");
}


int main(int argc, char **argv) {
int c, len;
res_x = 1680;
Expand Down Expand Up @@ -139,9 +138,6 @@ void configure_handle(gnuplot_ctrl * h, int number_of_events, int number_of_ele

gnuplot_cmd(h, "dx=.7");
gnuplot_cmd(h, "n=%d", number_of_events);
gnuplot_cmd(h, "total_box_width_relative=0.3");
gnuplot_cmd(h, "gap_width_relative=0.1");
gnuplot_cmd(h, "d_width=(gap_width_relative+total_box_width_relative)*dx/2.");

gnuplot_cmd(h,"list = ''");
gnuplot_cmd(h,"index(w) = words(substr(list, 0, strstrt(list, w)-1))");
Expand All @@ -153,24 +149,37 @@ void configure_handle(gnuplot_ctrl * h, int number_of_events, int number_of_ele

gnuplot_cmd(h, "set term png truecolor");
gnuplot_cmd(h, "set grid");
gnuplot_cmd(h, "set boxwidth total_box_width_relative/n relative");
//
gnuplot_cmd(h, "set style fill transparent solid 0.5 noborder");


gnuplot_cmd(h, "set term png size %d,%d", res_x, res_y);

gnuplot_cmd(h, "set ylabel \"Number of occurrences\"");

if(number_of_elements==1){
float x_top = 0.7+number_of_events/10.0;
float x_low = -0.7;
//printf("x_top = %.2f\nx_low = %.2f\n", x_top, x_low);
gnuplot_cmd(h, "set xrange [%.2f:%.2f]", x_low, x_top);
gnuplot_cmd(h, "total_box_width_relative=0.3");
gnuplot_cmd(h, "gap_width_relative=0.1");
gnuplot_cmd(h, "d_width=(gap_width_relative+total_box_width_relative)*dx/2.");
gnuplot_cmd(h, "set boxwidth total_box_width_relative/n");
}
else {
gnuplot_cmd(h, "total_box_width_relative=0.3");
gnuplot_cmd(h, "gap_width_relative=0.1");
gnuplot_cmd(h, "d_width=(gap_width_relative+total_box_width_relative)*dx/2.");
gnuplot_cmd(h, "set boxwidth total_box_width_relative/n relative");
}

/*
gnuplot_cmd(h, "set xrange [-1:%d]", number_of_elements);
*/
gnuplot_cmd(h, "set xtics out");
gnuplot_cmd(h, "set xtics nomirror");
gnuplot_cmd(h, "set xtics autofreq");
//gnuplot_cmd(h, "set xtics out");
//gnuplot_cmd(h, "set xtics nomirror");
//gnuplot_cmd(h, "set xtics autofreq");
gnuplot_cmd(h, "set xtics font \"monospace,%d\"", tics_font_size);
gnuplot_cmd(h, "set tic scale 0");
gnuplot_cmd(h, "set grid");
gnuplot_cmd(h, "set grid noxtics");

gnuplot_cmd(h, "set label at character 1,1 \"Generated with Papify\"");
gnuplot_cmd(h, "set format y \"%%.0se%%S\"");
Expand Down Expand Up @@ -616,7 +625,7 @@ event_acum_for_actor* process_data (char* path_todir, char* path_tofile, char* f
//adding to totals per actor
int label_set = 0;
datafile = fopen(path_to_totals,"r");
if(fgets(buf,1500,datafile)==NULL);// perror("");
if(fgets(buf,1500,datafile)==NULL);//nothing wrong here!
if(strstr(buf,"Actor;")!=NULL) label_set = 1;
fclose(datafile);

Expand Down

0 comments on commit c807fa5

Please sign in to comment.