From: Ethan A M. <merritt@u.washington.edu> - 2007-12-25 20:33:48
|
On Wednesday 19 December 2007 08:16, Allin Cottrell wrote: > I'm attaching a new .tgz file with 3 small patches, to > term/cairo.trm, src/eval.c and src/term_api.h. Jointly these > implement the writing of plot pixel bounds, with a possible scale > factor, using a new scalar variable rather than a new function > pointer. I like the idea, but unfortunately this code isn't working. If you look closely, you will find that the y coordinates being reported by this code are off by 17 pixels in the default 640x480 ouput from either 'set term png' or 'set term pngcairo'. This is because the coordinate mapping is more complicated. In the case of the png terminal: Y(coord) = (term->ymax - coord) Other terminals, particularly postscript, are more complicated yet. Postscript has to deal with landscape/portrait mode as well as bounding box offsets. I suspect that the only way to do this properly is to have each terminal report its own mapping. As an aside, I realized while looking at the patch code that aside from scaling these numbers are already available as axis_array[FIRST_X_AXIS].term_lower axis_array[FIRST_X_AXIS].term_upper and so on. Ethan -- Ethan A Merritt |