|
From: Allin C. <cot...@wf...> - 2007-11-26 17:21:59
|
I think my original posting on this got lost in a flood of other things, so I'm trying again. The idea: make available, via the print command, the "bounding box" of the actual plot area following a plot command. This is primarily intended for retrieving the pixel bounds for bitmapped graphics so as to be able to construct an "image map" (e.g. for a gnuplot-generated PNG file), but it may have other uses. Method: define 4 new internal variables, TERM_XMIN, TERM_XMAX, TERM_YMIN and TERM_YMAX. These get updated in eval.c after a plot (along with GRAPH_X_MIN and friends). A function is added to the term structure which enables -- but does not require -- a given terminal to supply a scale factor for these bounds. This is designed for pngcairo, which works in units of pixel/20, but might have application for some other terminals. Comment: This would be *very* useful for me, and others have expressed an interest in this sort of thing before. In the implementation I have tried to take into account suggestions from Hans and Ethan, and to respect the gnuplot architecture. Patch: The required small diffs to cairo.trm, eval.c and term_api.h (as per current CVS) are attached in a tarball. -- Allin Cottrell Department of Economics Wake Forest University, NC |