Browse Source

Variables xbrushwidth and gridwidth (to be set e.g. in

.spiceinit) allow setting separately the linewidths of the
graph (xbrushwidth) and the grid (gridwidth).
pre-master-46
Holger Vogt 8 years ago
parent
commit
3d009fef22
  1. 4
      README.utf8
  2. 17
      src/frontend/plotting/gnuplot.c
  3. 4
      src/frontend/postsc.c

4
README.utf8

@ -13,3 +13,7 @@ Postscript plotting uses only a UNICODE subset, namely
ISO-8859-1/ISO-8859-15, that allows extended ascii. ISO-8859-1/ISO-8859-15, that allows extended ascii.
Better looking fonts are now used for labelling the axes. Better looking fonts are now used for labelling the axes.
Variables xbrushwidth and gridlinewidth (to be set e.g. in
.spiceinit) allow setting separately the linewidths of the
graph (xbrushwidth) and the grid (gridlinewidth).

17
src/frontend/plotting/gnuplot.c

@ -56,7 +56,7 @@ void ft_gnuplot(double *xlims, double *ylims,
FILE *file, *file_data; FILE *file, *file_data;
struct dvec *v, *scale = NULL; struct dvec *v, *scale = NULL;
double xval, yval, prev_xval, extrange; double xval, yval, prev_xval, extrange;
int i, dir, numVecs, linewidth, err, terminal_type;
int i, dir, numVecs, linewidth, gridlinewidth, err, terminal_type;
bool xlog, ylog, nogrid, markers; bool xlog, ylog, nogrid, markers;
char buf[BSIZE_SP], pointstyle[BSIZE_SP], *text, plotstyle[BSIZE_SP], terminal[BSIZE_SP]; char buf[BSIZE_SP], pointstyle[BSIZE_SP], *text, plotstyle[BSIZE_SP], terminal[BSIZE_SP];
@ -108,9 +108,16 @@ void ft_gnuplot(double *xlims, double *ylims,
} }
} }
/* get linewidth for plotting the graph from .spiceinit */
if (!cp_getvar("xbrushwidth", CP_NUM, &linewidth, 0)) if (!cp_getvar("xbrushwidth", CP_NUM, &linewidth, 0))
linewidth = 1; linewidth = 1;
if (linewidth < 1) linewidth = 1; if (linewidth < 1) linewidth = 1;
/* get linewidth for grid from .spiceinit */
if (!cp_getvar("gridwidth", CP_NUM, &gridlinewidth, 0))
gridlinewidth = linewidth;
if (gridlinewidth < 1)
gridlinewidth = 1;
if (!cp_getvar("pointstyle", CP_STRING, pointstyle, sizeof(pointstyle))) { if (!cp_getvar("pointstyle", CP_STRING, pointstyle, sizeof(pointstyle))) {
markers = FALSE; markers = FALSE;
@ -188,8 +195,8 @@ void ft_gnuplot(double *xlims, double *ylims,
tfree(text); tfree(text);
} }
if (!nogrid) { if (!nogrid) {
if (linewidth > 1)
fprintf(file, "set grid lw %d \n" , linewidth);
if (gridlinewidth > 1)
fprintf(file, "set grid lw %d \n" , gridlinewidth);
else else
fprintf(file, "set grid\n"); fprintf(file, "set grid\n");
} }
@ -223,8 +230,8 @@ void ft_gnuplot(double *xlims, double *ylims,
fprintf(file, "#set ytics 1\n"); fprintf(file, "#set ytics 1\n");
fprintf(file, "#set y2tics 1\n"); fprintf(file, "#set y2tics 1\n");
if (linewidth > 1)
fprintf(file, "set border lw %d\n", linewidth);
if (gridlinewidth > 1)
fprintf(file, "set border lw %d\n", gridlinewidth);
if (plottype == PLOT_COMB) { if (plottype == PLOT_COMB) {
strcpy(plotstyle, "boxes"); strcpy(plotstyle, "boxes");

4
src/frontend/postsc.c

@ -129,13 +129,13 @@ int PS_Init(void)
} }
/* get linewidth information from spinit */ /* get linewidth information from spinit */
if (!cp_getvar("xbrushwidth", CP_REAL, &linewidth))
if (!cp_getvar("xbrushwidth", CP_REAL, &linewidth, 0))
linewidth = 0; linewidth = 0;
if (linewidth < 0) if (linewidth < 0)
linewidth = 0; linewidth = 0;
/* get linewidth for grid from spinit */ /* get linewidth for grid from spinit */
if (!cp_getvar("gridwidth", CP_REAL, &gridlinewidth))
if (!cp_getvar("gridwidth", CP_REAL, &gridlinewidth, 0))
gridlinewidth = linewidth; gridlinewidth = linewidth;
if (gridlinewidth < 0) if (gridlinewidth < 0)
gridlinewidth = 0; gridlinewidth = 0;

Loading…
Cancel
Save