@@ -59,7 +59,6 @@ void printhelp(char** argv){
59
59
"\tsudo apt-get install gnuplot\n\n" );
60
60
}
61
61
62
-
63
62
int main (int argc , char * * argv ) {
64
63
int c , len ;
65
64
res_x = 1680 ;
@@ -139,9 +138,6 @@ void configure_handle(gnuplot_ctrl * h, int number_of_events, int number_of_ele
139
138
140
139
gnuplot_cmd (h , "dx=.7" );
141
140
gnuplot_cmd (h , "n=%d" , number_of_events );
142
- gnuplot_cmd (h , "total_box_width_relative=0.3" );
143
- gnuplot_cmd (h , "gap_width_relative=0.1" );
144
- gnuplot_cmd (h , "d_width=(gap_width_relative+total_box_width_relative)*dx/2." );
145
141
146
142
gnuplot_cmd (h ,"list = ''" );
147
143
gnuplot_cmd (h ,"index(w) = words(substr(list, 0, strstrt(list, w)-1))" );
@@ -153,24 +149,37 @@ void configure_handle(gnuplot_ctrl * h, int number_of_events, int number_of_ele
153
149
154
150
gnuplot_cmd (h , "set term png truecolor" );
155
151
gnuplot_cmd (h , "set grid" );
156
- gnuplot_cmd ( h , "set boxwidth total_box_width_relative/n relative" );
152
+ //
157
153
gnuplot_cmd (h , "set style fill transparent solid 0.5 noborder" );
158
154
159
155
160
156
gnuplot_cmd (h , "set term png size %d,%d" , res_x , res_y );
161
157
162
158
gnuplot_cmd (h , "set ylabel \"Number of occurrences\"" );
163
159
160
+ if (number_of_elements == 1 ){
161
+ float x_top = 0.7 + number_of_events /10.0 ;
162
+ float x_low = -0.7 ;
163
+ //printf("x_top = %.2f\nx_low = %.2f\n", x_top, x_low);
164
+ gnuplot_cmd (h , "set xrange [%.2f:%.2f]" , x_low , x_top );
165
+ gnuplot_cmd (h , "total_box_width_relative=0.3" );
166
+ gnuplot_cmd (h , "gap_width_relative=0.1" );
167
+ gnuplot_cmd (h , "d_width=(gap_width_relative+total_box_width_relative)*dx/2." );
168
+ gnuplot_cmd (h , "set boxwidth total_box_width_relative/n" );
169
+ }
170
+ else {
171
+ gnuplot_cmd (h , "total_box_width_relative=0.3" );
172
+ gnuplot_cmd (h , "gap_width_relative=0.1" );
173
+ gnuplot_cmd (h , "d_width=(gap_width_relative+total_box_width_relative)*dx/2." );
174
+ gnuplot_cmd (h , "set boxwidth total_box_width_relative/n relative" );
175
+ }
164
176
165
- /*
166
- gnuplot_cmd(h, "set xrange [-1:%d]", number_of_elements);
167
- */
168
- gnuplot_cmd (h , "set xtics out" );
169
- gnuplot_cmd (h , "set xtics nomirror" );
170
- gnuplot_cmd (h , "set xtics autofreq" );
177
+ //gnuplot_cmd(h, "set xtics out");
178
+ //gnuplot_cmd(h, "set xtics nomirror");
179
+ //gnuplot_cmd(h, "set xtics autofreq");
171
180
gnuplot_cmd (h , "set xtics font \"monospace,%d\"" , tics_font_size );
172
181
gnuplot_cmd (h , "set tic scale 0" );
173
- gnuplot_cmd (h , "set grid" );
182
+ gnuplot_cmd (h , "set grid noxtics " );
174
183
175
184
gnuplot_cmd (h , "set label at character 1,1 \"Generated with Papify\"" );
176
185
gnuplot_cmd (h , "set format y \"%%.0se%%S\"" );
@@ -616,7 +625,7 @@ event_acum_for_actor* process_data (char* path_todir, char* path_tofile, char* f
616
625
//adding to totals per actor
617
626
int label_set = 0 ;
618
627
datafile = fopen (path_to_totals ,"r" );
619
- if (fgets (buf ,1500 ,datafile )== NULL );// perror("");
628
+ if (fgets (buf ,1500 ,datafile )== NULL );//nothing wrong here!
620
629
if (strstr (buf ,"Actor;" )!= NULL ) label_set = 1 ;
621
630
fclose (datafile );
622
631
0 commit comments