add variable ticchar, allow an arbitrary character as ticmark

This commit is contained in:
Holger Vogt 2020-02-07 22:44:36 +01:00
parent 2ef62c934d
commit 7d9062f1f9
2 changed files with 7 additions and 12 deletions

View File

@ -120,6 +120,10 @@ int gr_init(double *xlims, double *ylims, /* The size of the screen. */
}
}
if (!cp_getvar("ticchar", CP_STRING, graph->ticchar, 1)) {
strcpy(graph->ticchar, "X");
}
if (cp_getvar("ticlist", CP_LIST, ticlist, 0)) {
wl = vareval("ticlist");
ticlist = wl_flatten(wl);
@ -300,26 +304,16 @@ void gr_point(struct dvec *dv,
if ((tics = currentgraph->ticdata) != NULL) {
for (; *tics < HUGE; tics++)
if (*tics == (double) np) {
DevDrawText("x", (int) (tox - currentgraph->fontwidth / 2),
DevDrawText(currentgraph->ticchar, (int) (tox - currentgraph->fontwidth / 2),
(int) (toy - currentgraph->fontheight / 2), 0);
/* gr_redraw will redraw this w/o our having to save it
Guenther Roehrich 22-Jan-99 */
/* SaveText(currentgraph, "x",
(int) (tox - currentgraph->fontwidth / 2),
(int) (toy - currentgraph->fontheight / 2)); */
break;
}
}
else if ((currentgraph->ticmarks >0) && (np > 0) &&
(np % currentgraph->ticmarks == 0)) {
/* Draw an 'x' */
DevDrawText("x", (int) (tox - currentgraph->fontwidth / 2),
DevDrawText(currentgraph->ticchar, (int) (tox - currentgraph->fontwidth / 2),
(int) (toy - currentgraph->fontheight / 2), 0);
/* gr_redraw will redraw this w/o our having to save it
Guenther Roehrich 22-Jan-99 */
/* SaveText(currentgraph, "x",
(int) (tox - currentgraph->fontwidth / 2),
(int) (toy - currentgraph->fontheight / 2)); */
}
break;
case PLOT_COMB:

View File

@ -61,6 +61,7 @@ struct graph {
int ticmarks; /* mark every ticmark'th point */
double *ticdata;
char ticchar[2];
int fontwidth, fontheight; /* for use in grid */
PLOTTYPE plottype; /* defined in FTEconstant.h */