--- imach/src/imach.c 2017/06/30 13:39:33 1.275 +++ imach/src/imach.c 2017/06/30 15:48:31 1.276 @@ -1,6 +1,9 @@ -/* $Id: imach.c,v 1.275 2017/06/30 13:39:33 brouard Exp $ +/* $Id: imach.c,v 1.276 2017/06/30 15:48:31 brouard Exp $ $State: Exp $ $Log: imach.c,v $ + Revision 1.276 2017/06/30 15:48:31 brouard + Summary: Graphs improvements + Revision 1.275 2017/06/30 13:39:33 brouard Summary: Saito's color @@ -1028,12 +1031,12 @@ typedef struct { #define ODIRSEPARATOR '\\' #endif -/* $Id: imach.c,v 1.275 2017/06/30 13:39:33 brouard Exp $ */ +/* $Id: imach.c,v 1.276 2017/06/30 15:48:31 brouard Exp $ */ /* $State: Exp $ */ #include "version.h" char version[]=__IMACH_VERSION__; char copyright[]="February 2016,INED-EUROREVES-Institut de longevite-Japan Society for the Promotion of Science (Grant-in-Aid for Scientific Research 25293121), Intel Software 2015-2018"; -char fullversion[]="$Revision: 1.275 $ $Date: 2017/06/30 13:39:33 $"; +char fullversion[]="$Revision: 1.276 $ $Date: 2017/06/30 15:48:31 $"; char strstart[80]; char optionfilext[10], optionfilefiname[FILENAMELENGTH]; int erreur=0, nberr=0, nbwarn=0; /* Error number, number of errors number of warnings */ @@ -7052,7 +7055,8 @@ void printinggnuplot(char fileresu[], ch fprintf(ficgp,"\nset out \"%s_%d-%d-%d.svg\" \n",subdirf2(optionfilefiname,"V_"),cpt,k1,nres); fprintf(ficgp,"\n#set out \"V_%s_%d-%d-%d.svg\" \n",optionfilefiname,cpt,k1,nres); - fprintf(ficgp,"set label \"Alive state %d %s\" at graph 0.98,0.5 center rotate font \"Helvetica,12\"\n",cpt,gplotlabel); + /* fprintf(ficgp,"set label \"Alive state %d %s\" at graph 0.98,0.5 center rotate font \"Helvetica,12\"\n",cpt,gplotlabel); */ + fprintf(ficgp,"set title \"Alive state %d %s\" font \"Helvetica,12\"\n",cpt,gplotlabel); fprintf(ficgp,"set xlabel \"Age\" \nset ylabel \"Probability\" \nset ter svg size 640, 480\nplot [%.f:%.f] \"%s\" every :::%d::%d u 1:($2==%d ? $3:1/0) \"%%lf %%lf",ageminpar,fage,subdirf2(fileresu,"VPL_"),nres-1,nres-1,nres); /* fprintf(ficgp,"set xlabel \"Age\" \nset ylabel \"Probability\" \nset ter svg size 640, 480\nplot [%.f:%.f] \"%s\" every :::%d::%d u 1:($2==%d ? $3:1/0) \"%%lf %%lf",ageminpar,fage,subdirf2(fileresu,"VPL_"),k1-1,k1-1,nres); */ /* k1-1 error should be nres-1*/ @@ -7137,7 +7141,7 @@ void printinggnuplot(char fileresu[], ch if (i==cpt) fprintf(ficgp," %%lf (%%lf)"); else fprintf(ficgp," %%*lf (%%*lf)"); } - fprintf(ficgp,"\" t\"95%% CI\" w l lt 5,\"%s\" every :::%d::%d u 1:($2==%d ? $3-1.96*$4 : 1/0) \"%%lf %%lf",subdirf2(fileresu,"VBL_"),nres-1,nres-1,nres); + fprintf(ficgp,"\" t\"95%% CI\" w l lt 4,\"%s\" every :::%d::%d u 1:($2==%d ? $3-1.96*$4 : 1/0) \"%%lf %%lf",subdirf2(fileresu,"VBL_"),nres-1,nres-1,nres); for (i=1; i<= nlstate ; i ++) { if (i==cpt) fprintf(ficgp," %%lf (%%lf)"); else fprintf(ficgp," %%*lf (%%*lf)"); @@ -7145,7 +7149,8 @@ void printinggnuplot(char fileresu[], ch fprintf(ficgp,"\" t\"\" w l lt 4"); } /* end if backprojcast */ } /* end if backcast */ - fprintf(ficgp,"\nset out ;unset label;\n"); + /* fprintf(ficgp,"\nset out ;unset label;\n"); */ + fprintf(ficgp,"\nset out ;unset title;\n"); } /* nres */ } /* k1 */ } /* cpt */ @@ -7759,7 +7764,7 @@ set ter svg size 640, 480\nunset log y\n continue; fprintf(ficgp,"\n\n# Combination of dummy k1=%d which is ",k1); strcpy(gplotlabel,"("); - sprintf(gplotlabel+strlen(gplotlabel)," Dummy combination %d ",k1); + /*sprintf(gplotlabel+strlen(gplotlabel)," Dummy combination %d ",k1);*/ for (k=1; k<=cptcoveff; k++){ /* For each correspondig covariate value */ lv= decodtabm(k1,k,cptcoveff); /* Should be the covariate value corresponding to k1 combination and kth covariate */ /* decodtabm(1,1,4) = 1 because h=1 k= (1) 1 1 1 */ @@ -7776,7 +7781,9 @@ set ter svg size 640, 480\nunset log y\n strcpy(gplotlabel+strlen(gplotlabel),")"); fprintf(ficgp,"\n#\n"); fprintf(ficgp,"\nset out \"%s_%d-%d-%d.svg\" ",subdirf2(optionfilefiname,"PE_"),k1,ng,nres); - fprintf(ficgp,"\nset label \"%s\" at graph 0.98,0.5 center rotate font \"Helvetica,12\"\n",gplotlabel); + fprintf(ficgp,"\nset key outside "); + /* fprintf(ficgp,"\nset label \"%s\" at graph 1.2,0.5 center rotate font \"Helvetica,12\"\n",gplotlabel); */ + fprintf(ficgp,"\nset title \"%s\" font \"Helvetica,12\"\n",gplotlabel); fprintf(ficgp,"\nset ter svg size 640, 480 "); if (ng==1){ fprintf(ficgp,"\nset ylabel \"Value of the logit of the model\"\n"); /* exp(a12+b12*x) could be nice */ @@ -7896,12 +7903,12 @@ set ter svg size 640, 480\nunset log y\n } fprintf(ficgp,")"); if(ng ==2) - fprintf(ficgp," w l lt (%d*%d+%d)%%%d+1 dt %d t \"p%d%d\" ", nlstate+ndeath, k2, k, nlstate+ndeath, k2, k2,k); + fprintf(ficgp," w l lw 2 lt (%d*%d+%d)%%%d+1 dt %d t \"p%d%d\" ", nlstate+ndeath, k2, k, nlstate+ndeath, k2, k2,k); else /* ng= 3 */ - fprintf(ficgp," w l lt (%d*%d+%d)%%%d+1 dt %d t \"i%d%d\" ", nlstate+ndeath, k2, k, nlstate+ndeath, k2, k2,k); + fprintf(ficgp," w l lw 2 lt (%d*%d+%d)%%%d+1 dt %d t \"i%d%d\" ", nlstate+ndeath, k2, k, nlstate+ndeath, k2, k2,k); }else{ /* end ng <> 1 */ if( k !=k2) /* logit p11 is hard to draw */ - fprintf(ficgp," w l lt (%d*%d+%d)%%%d+1 dt %d t \"logit(p%d%d)\" ", nlstate+ndeath, k2, k, nlstate+ndeath, k2, k2,k); + fprintf(ficgp," w l lw 2 lt (%d*%d+%d)%%%d+1 dt %d t \"logit(p%d%d)\" ", nlstate+ndeath, k2, k, nlstate+ndeath, k2, k2,k); } if ((k+k2)!= (nlstate*2+ndeath) && ng != 1) fprintf(ficgp,","); @@ -7910,7 +7917,8 @@ set ter svg size 640, 480\nunset log y\n i=i+ncovmodel; } /* end k */ } /* end k2 */ - fprintf(ficgp,"\n set out; unset label;\n"); + /* fprintf(ficgp,"\n set out; unset label;set key default;\n"); */ + fprintf(ficgp,"\n set out; unset title;set key default;\n"); } /* end k1 */ } /* end ng */ /* avoid: */