|
From: Allin C. <cot...@wf...> - 2007-12-28 00:20:16
|
Ethan first wrote: > 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'... I demurred, and Ethan clarified thus: > The problem is in the convention that defines y. If I create a > plot using > set term pngcairo > set output 'cairo.png' > plot sin(x)/x > show var all > I get > TERM_XMIN = 64 > TERM_XMAX = 615 > TERM_YMIN = 37 > TERM_YMAX = 460 > If I now open up cairo.png in GIMP or ImageMagick, I get y pixel > readouts: > bottom of plot 443 (= 480 - 37) > top of plot 20 (= 480 - 460) > Notice that the convention is that Y=0 at the top of the image. > The problem comes if one tries to interpret the bounds [37:460] > as refering to the offset in pixels from the bottom of the image. > If you do that, then the values are off by 17 pixels. True, but surely all that's needed is some indication in the documentation of the proposed new variables, that gnuplot takes Y=0 to be at the bottom of the image. IMO there's no point in trying to second-guess what use people might want to make of these dimensions. Anyone wanting to use them on X11 will know that Y=0 is at the top in that context, and can easily adjust accordingly. Allin Cottrell |