avoid retrace in output graph by adding label 'noretraceplot'
to the plot command, that creates a lin plot trying to avoid retracing
This commit is contained in:
parent
611596c916
commit
d4adb027d2
|
|
@ -267,7 +267,7 @@ gr_point(struct dvec *dv,
|
|||
switch (currentgraph->plottype) {
|
||||
double *tics;
|
||||
case PLOT_LIN:
|
||||
|
||||
case PLOT_MONOLIN:
|
||||
/* If it's a linear plot, ignore first point since we don't
|
||||
want to connect with oldx and oldy. */
|
||||
if (np)
|
||||
|
|
|
|||
|
|
@ -130,6 +130,7 @@ ft_graf(struct dvec *v, struct dvec *xs, bool nostart)
|
|||
* interpolation.
|
||||
*/
|
||||
if ((degree == 1) && (gridsize == 0)) {
|
||||
bool mono = (currentgraph->plottype == PLOT_MONOLIN);
|
||||
dir = 0;
|
||||
for (i = 0, j = v->v_length; i < j; i++) {
|
||||
dx = isreal(xs) ? xs->v_realdata[i] :
|
||||
|
|
@ -137,7 +138,7 @@ ft_graf(struct dvec *v, struct dvec *xs, bool nostart)
|
|||
dy = isreal(v) ? v->v_realdata[i] :
|
||||
realpart(v->v_compdata[i]);
|
||||
if ((i == 0 || (dir > 0 ? lx > dx : dir < 0 ? lx < dx : 0)) &&
|
||||
xs->v_plot && xs->v_plot->pl_scale == xs)
|
||||
(mono || (xs->v_plot && xs->v_plot->pl_scale == xs)))
|
||||
{
|
||||
gr_point(v, dx, dy, lx, ly, 0);
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -454,6 +454,14 @@ plotit(wordlist *wl, char *hcopy, char *devname)
|
|||
pfound = TRUE;
|
||||
}
|
||||
}
|
||||
if (getflag(wl, "noretraceplot")) {
|
||||
if (pfound) {
|
||||
fprintf(cp_err, "Warning: too many plot types given\n");
|
||||
} else {
|
||||
ptype = PLOT_MONOLIN;
|
||||
pfound = TRUE;
|
||||
}
|
||||
}
|
||||
if (getflag(wl, "combplot")) {
|
||||
if (pfound) {
|
||||
fprintf(cp_err, "Warning: too many plot types given\n");
|
||||
|
|
@ -475,6 +483,8 @@ plotit(wordlist *wl, char *hcopy, char *devname)
|
|||
if (cp_getvar("plotstyle", CP_STRING, buf)) {
|
||||
if (eq(buf, "linplot"))
|
||||
ptype = PLOT_LIN;
|
||||
else if (eq(buf, "noretraceplot"))
|
||||
ptype = PLOT_MONOLIN;
|
||||
else if (eq(buf, "combplot"))
|
||||
ptype = PLOT_COMB;
|
||||
else if (eq(buf, "pointplot"))
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ enum dvec_flags {
|
|||
|
||||
/* Plot types. */
|
||||
typedef enum {
|
||||
PLOT_LIN, PLOT_COMB, PLOT_POINT
|
||||
PLOT_LIN, PLOT_COMB, PLOT_POINT, PLOT_MONOLIN
|
||||
} PLOTTYPE;
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue