diff -uN gnuplot-current-5/src/axis.h.ORG gnuplot-current-5/src/axis.h
--- gnuplot-current-5/src/axis.h.ORG	Sat Aug  9 18:17:54 2008
+++ gnuplot-current-5/src/axis.h	Mon Aug 11 19:53:11 2008
@@ -104,6 +104,11 @@
 	   struct {			/* for TIC_SERIES */
 		  double start, incr;
 		  double end;		/* ymax, if VERYLARGE */
+ /* shige */
+#ifdef UseTicFunc
+	          struct udft_entry pos_func;
+	          struct udft_entry label_func;
+#endif
 	   } series;
 	   TBOOLEAN mix;		/* TRUE to use both the above */
     } def;
diff -uN gnuplot-current-5/src/axis.c.ORG gnuplot-current-5/src/axis.c
--- gnuplot-current-5/src/axis.c.ORG	Sat Aug  9 18:17:56 2008
+++ gnuplot-current-5/src/axis.c	Mon Aug 11 20:12:33 2008
@@ -909,6 +909,12 @@
 
 	/* gprintf uses log10() of base - log_base_array is log() */
 	double log10_base = axis_array[axis].log ? log10(axis_array[axis].base) : 1.0;
+/* shige */
+#ifdef UseTicFunc
+	double ticorg;
+	int use_pos_fp = 0, use_label_fp = 0;
+	struct udft_entry *pos_fp, *label_fp;
+#endif
 
 	if (lmax < lmin) {
 	    /* hmm - they have set reversed range for some reason */
@@ -1053,10 +1059,38 @@
 	    return;		/* just quietly ignore them ! */
 	/* }}} */
 
+/* shige */
+#ifdef UseTicFunc
+	pos_fp = &axis_array[axis].ticdef.def.series.pos_func;
+	if (pos_fp->at) 
+	  use_pos_fp = 1;
+	label_fp = &axis_array[axis].ticdef.def.series.label_func;
+	if (label_fp->at) 
+	  use_label_fp = 1;
+#endif
+/* shige */	
+#if 0
+	    fprintf(stderr,"DEBUG: (start,step,end)=(%f,%f,%f)\n",
+		    start,step,end);
+#endif
 	/* FIXME HBB 20010121: keeping adding 'step' to 'tic' is
 	 * begging for rounding errors to strike us. */
 	/* HBB 20010410: ... and strike they did :-( */
 	for (tic = start; tic <= end; tic += step) {
+/* shige */
+#if 0
+	    fprintf(stderr,"DEBUG: tic=%f\n",tic);
+#endif
+/* shige */
+#ifdef UseTicFunc
+	    if (use_pos_fp){
+		struct value val;
+		ticorg = tic;
+		(void) Gcomplex(&pos_fp->dummy_values[0], tic, 0.0);
+		evaluate_at(pos_fp->at, &val);
+		tic = undefined ? 0.0 : real(&val);
+	    }
+#endif
 	    if (anyticput == 2)	/* See below... */
 		break;
 	    /* HBB 20010121: Previous code checked absolute value
@@ -1065,11 +1099,20 @@
 	     * all axes shorter than DBL_EPSILON in absolute figures.
 	     * */
 	    if (anyticput) {
+/* shige */
+#ifndef UseTicFunc
 	      if (NearlyEqual(tic, start, step)) {
+#else
+	      if (!use_pos_fp && NearlyEqual(tic, start, step)) {
+#endif
 		/* step is too small.. */
 		anyticput = 2;	/* Don't try again. */
 		tic = end;	/* Put end tic. */
+#ifndef UseTicFunc
 	      } else if (NearlyEqual(tic, end, step)) {
+#else
+	      } else if (!use_pos_fp && NearlyEqual(tic, end, step)) {
+#endif
 		/* HBB 20010410: protect against cancellation at upper
 		 * end, too (can happen if |step/end| <= ~DBL_EPS). */
 		anyticput = 2;
@@ -1088,6 +1131,10 @@
 		internal = tic;
 		user = AXIS_UNDO_LOG(axis, internal);
 	    }
+/* shige */
+#if 0
+	    fprintf(stderr,"DEBUG: (tic,user)=(%f,%f)\n",tic,user);
+#endif
 	    /* }}} */
 	    if (internal > internal_max)
 		break;		/* gone too far - end of series = VERYLARGE perhaps */
@@ -1110,6 +1157,16 @@
 		    }
 		default:{	/* comp or series */
 			char label[64];
+/* shige */
+#ifdef UseTicFunc
+			if (use_label_fp){
+			    struct value val;
+			    (void) Gcomplex(&label_fp->dummy_values[0], 
+					    ticorg, 0.0);
+			    evaluate_at(label_fp->at, &val);
+			    strncpy(label,val.v.string_val,64);
+			} else
+#endif
 			if (axis_array[axis].is_timedata) {
 			    /* If they are doing polar time plot, good luck to them */
 			    gstrftime(label, 24, ticfmt[axis], (double) user);
@@ -1146,6 +1203,11 @@
 		}
 		/* }}} */
 	    }
+/* shige */
+#ifdef UseTicFunc 
+	    if (use_pos_fp)
+	      tic = ticorg;
+#endif
 	}
     }
 }
diff -uN gnuplot-current-5/src/set.c.ORG gnuplot-current-5/src/set.c
--- gnuplot-current-5/src/set.c.ORG	Sat Aug  9 18:17:55 2008
+++ gnuplot-current-5/src/set.c	Mon Aug 11 19:52:53 2008
@@ -151,6 +151,10 @@
 static void load_tics __PROTO((AXIS_INDEX axis));
 static void load_tic_user __PROTO((AXIS_INDEX axis));
 static void load_tic_series __PROTO((AXIS_INDEX axis));
+/* shige */
+#ifdef UseTicFunc
+static void set_tic_function __PROTO((AXIS_INDEX axis));
+#endif
 
 static void set_linestyle __PROTO((void));
 static void set_arrowstyle __PROTO((void));
@@ -4989,6 +4993,19 @@
 	    GET_NUM_OR_TIME(end, axis);
 	}
 
+/* shige */
+#ifdef UseTicFunc
+	if (equals(c_token, ",")) { 
+	    set_tic_function(axis);
+	} else if (tdef->def.series.pos_func.at) {
+	    free_at(tdef->def.series.pos_func.at);
+	    tdef->def.series.pos_func.at = NULL;
+	    if (tdef->def.series.label_func.at) {
+		free_at(tdef->def.series.label_func.at);
+		tdef->def.series.label_func.at = NULL;
+	    }
+	}
+#endif
 	if (start < end && incr <= 0)
 	    int_error(incr_token, "increment must be positive");
 	if (start > end && incr >= 0)
@@ -5013,6 +5030,51 @@
     tdef->def.series.end = end;
 }
 
+/* shige */
+#ifdef UseTicFunc
+static void
+set_tic_function(AXIS_INDEX axis)
+{
+    int start_token;
+    char saved_dummy_var[MAX_ID_LEN+1];
+    struct ticdef *tdef = &axis_array[axis].ticdef;
+
+    ++c_token;
+    strncpy( saved_dummy_var, c_dummy_var[0], MAX_ID_LEN );
+    strncpy( c_dummy_var[0], "n", MAX_ID_LEN );
+    start_token = c_token;
+    if (tdef->def.series.pos_func.at) {
+        free_at( tdef->def.series.pos_func.at );
+	tdef->def.series.pos_func.at = NULL;
+    }
+    dummy_func = &(tdef->def.series.pos_func);
+    tdef->def.series.pos_func.at = perm_at();
+    if (! tdef->def.series.pos_func.at)
+	int_error(start_token, "not enough memory for function");
+#if 0
+    m_capture(&(tdef->def.series.pos_func.definition), start_token, c_token-1);
+#endif
+    dummy_func = NULL;
+    if (!equals(c_token,",")) {
+	tdef->def.series.label_func.at=NULL;
+	return;
+    }
+    ++c_token;
+    start_token = c_token;
+    if (tdef->def.series.label_func.at) {
+        free_at( tdef->def.series.label_func.at );
+	tdef->def.series.label_func.at = NULL;
+    }
+    dummy_func = &(tdef->def.series.label_func);
+    tdef->def.series.label_func.at = perm_at();
+    if (! tdef->def.series.label_func.at)
+	int_error(start_token, "not enough memory for function");
+#if 0
+    m_capture(&(tdef->def.series.label_func.definition), start_token, c_token-1);
+#endif
+    dummy_func = NULL;
+}
+#endif /* UseTicFunc */
 
 /* return 1 if format looks like a numeric format
  * ie more than one %{efg}, or %something-else
