/* Plotting the graph of a 1-argument function. */ /* Last edited on 2003-09-25 09:45:47 by stolfi */ #ifndef fltgraph_H #define fltgraph_H #include #include #include /* These procedures assume that {*psfile} is a Postscript output file, properly initialized for a plot with the given coordinate ranges. */ void fltgraph_plot ( FILE *psfile, Float f (Float x), Interval xd, Interval yd, int m ); /* Draws the graph of {f(x)} for {x \in xd}, approximated by {m} straight segments. */ void fltgraph_draw_axes ( FILE *psfile, Interval xd, Interval yd ); /* Draws the parts of the coordinates axes that lie in the specified rectangle. */ void fltgraph_draw_ticks ( FILE *psfile, int axis, Float lo, Float hi, int n, double ticksz, char *labfmt, double labalign, Interval clip ); /* Draws {n+1} coordinate ticks on the given axis, from {lo} to {hi}. The ticks measure {ticksz} millimeters irrespective of the plot scale. If {labfmt} is not null, also writes the coordinate value, with that format. The parameter {labalign} is the relative point of the label that should be placed on the axis; i.e., {labalign < 0} places the label on the positive side of the axis, {labalign > 1.0 places it on the negative side, and {labalign = 0.5} places the label centered on the axis. Supresses ticks that are outside the {clip} interval. */ #endif