Add save_files_only option to the gnuplot command.
The .plt and .data files are saved but gnuplot is not invoked. For example: gnuplot name save_files_only plotargs
This commit is contained in:
parent
2cf6e80a70
commit
eb51bc90f7
|
|
@ -257,7 +257,7 @@ void ft_gnuplot(double *xlims, double *ylims,
|
|||
const char *filename, const char *title,
|
||||
const char *xlabel, const char *ylabel,
|
||||
GRIDTYPE gridtype, PLOTTYPE plottype,
|
||||
struct dvec *vecs, bool xycontour)
|
||||
struct dvec *vecs, bool xycontour, bool save_files_only)
|
||||
{
|
||||
FILE *file, *file_data;
|
||||
struct dvec *v, *scale = NULL;
|
||||
|
|
@ -645,6 +645,11 @@ void ft_gnuplot(double *xlims, double *ylims,
|
|||
(void) sprintf(buf, "gnuplot -persist %s &", filename_plt);
|
||||
}
|
||||
#endif
|
||||
if (save_files_only) {
|
||||
printf("Saving gnuplot plt file %s\n", filename_plt);
|
||||
printf("Saving gnuplot data file %s\n", filename_data);
|
||||
return;
|
||||
}
|
||||
err = system(buf);
|
||||
|
||||
/* delete the plt and data files */
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ void ft_gnuplot(double *xlims, double *ylims,
|
|||
const char *filename, const char *title,
|
||||
const char *xlabel, const char *ylabel,
|
||||
GRIDTYPE gridtype, PLOTTYPE plottype,
|
||||
struct dvec *vecs, bool xycontour);
|
||||
struct dvec *vecs, bool xycontour, bool save_files_only);
|
||||
|
||||
|
||||
void ft_writesimple(double *xlims, double *ylims,
|
||||
|
|
|
|||
|
|
@ -288,6 +288,7 @@ bool plotit(wordlist *wl, const char *hcopy, const char *devname)
|
|||
static PLOTTYPE ptype = PLOT_LIN;
|
||||
|
||||
bool gfound = FALSE, pfound = FALSE, oneval = FALSE, contour2d = FALSE, digitop = FALSE;
|
||||
bool save_files_only = FALSE;
|
||||
double ylims[2], xlims[2];
|
||||
struct pnode *pn, *names = NULL;
|
||||
struct dvec *d = NULL, *vecs = NULL, *lv = NULL, *lastvs = NULL;
|
||||
|
|
@ -364,6 +365,11 @@ bool plotit(wordlist *wl, const char *hcopy, const char *devname)
|
|||
/* See if contours for 2D Cider data can be plotted with gnuplot */
|
||||
contour2d = getflag(wl, "xycontour");
|
||||
|
||||
/* save_files_only to save gnuplot plt and data files without plotting */
|
||||
if (devname && eq(devname, "gnuplot")) {
|
||||
save_files_only = getflag(wl, "save_files_only");
|
||||
}
|
||||
|
||||
/* Now extract all the parameters. */
|
||||
digitop = getflag(wl, "digitop");
|
||||
|
||||
|
|
@ -1208,7 +1214,7 @@ bool plotit(wordlist *wl, const char *hcopy, const char *devname)
|
|||
title ? title : vecs->v_plot->pl_title,
|
||||
xlabel ? xlabel : ft_typabbrev(vecs->v_scale->v_type),
|
||||
ylabel ? ylabel : ft_typabbrev(y_type),
|
||||
gtype, ptype, vecs, contour2d);
|
||||
gtype, ptype, vecs, contour2d, save_files_only);
|
||||
rtn = TRUE;
|
||||
goto quit;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue