Changeset 20191
- Timestamp:
- Oct 16, 2008, 9:19:23 AM (18 years ago)
- File:
-
- 1 edited
-
trunk/Ohana/src/relphot/src/plotstuff.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/relphot/src/plotstuff.c
r14590 r20191 25 25 sprintf (name, "gastro [%d]", N); 26 26 27 // XXX need to allow for KapaOpenNamed socket instead 28 Xgraph[N] = KapaOpen ("kapa", name); 27 // if -plot is supplied, the plots are shown on the screen; 28 // otherwise, only the final plots are generated and saved without display 29 if (PLOTSTUFF) { 30 Xgraph[N] = KapaOpen ("kapa", name); 31 } else { 32 Xgraph[N] = KapaOpen ("kapa -noX", name); 33 } 29 34 30 35 if (Xgraph[N] < 0) { … … 38 43 39 44 if (Xgraph[N] == 0) return; 40 41 45 KapaBox (Xgraph[N], graphmode); 42 46 return; … … 66 70 67 71 KapaClearSections (Xgraph[N]); 72 73 KapaSetLimits (Xgraph[N], graphmode); 74 KapaSetFont (Xgraph[N], "helvetica", 14); 75 KapaBox (Xgraph[N], graphmode); 76 // KapaSendLabel (Xgraph[N], "PSF Mag", KAPA_LABEL_XM); 77 // KapaSendLabel (Xgraph[N], "Ap Mag - PSF Mag", KAPA_LABEL_YM); 68 78 69 79 KapaPrepPlot (Xgraph[N], Npts, graphmode); … … 95 105 } 96 106 97 void plot_list (Graphdata *graphdata, double *xlist, double *ylist, int N, char *label, char *file) { 107 // plot the vector pair to a file with name defined by the varargs format 108 void plot_list (Graphdata *graphdata, double *xlist, double *ylist, int N, char *label, char *format, ...) { 98 109 99 int i; 110 char tmp, *filename; 111 int i, Nbyte; 100 112 StatType stats; 113 va_list argp; 114 115 va_start (argp, format); 116 Nbyte = vsnprintf (&tmp, 0, format, argp); 117 va_end (argp); 118 if (!Nbyte) return; 119 Nbyte ++; 120 121 ALLOCATE (filename, char, Nbyte); 122 va_start (argp, format); 123 vsnprintf (filename, Nbyte, format, argp); 124 va_end (argp); 101 125 102 126 stats.min = stats.max = xlist[0]; … … 122 146 DonePlotting (graphdata, 0); 123 147 124 if ( (file != NULL) && SAVEPLOT) JpegPlot (graphdata, 0, file);148 if (SAVEPLOT) JpegPlot (graphdata, 0, filename); 125 149 if (PLOTDELAY > 500000) { 126 150 fprintf (stdout, "press return\n"); … … 129 153 usleep (PLOTDELAY); 130 154 } 155 free (filename); 131 156 } 132 157
Note:
See TracChangeset
for help on using the changeset viewer.
