|
From: Ethan A M. <sf...@us...> - 2014-06-19 17:56:31
|
On Thursday, 19 June, 2014 10:41:16 Philipp K. Janert wrote: > > Gnuplot makes a lot of information about the most > recent plot available through GPVAL variables. It > seems reasonable to include information about the > current position of the key. > > I prepared a small patch that populates four new > variables for each plot: > GPVAL_KEY_XCENTER > GPVAL_KEY_YCENTER > GPVAL_KEY_WIDTH > GPVAL_KEY_HEIGHT > > Using the information in these variables, one can > recreate the most recent positioning of the key > as follows: > > plot sin(x) > set key center at screen \ > GPVAL_KEY_XCENTER/GPVAL_TERM_XSIZE,GPVAL_KEY_YCENTER/GPVAL_TERM_YSIZE > replot > > For 3dim graphs, there is an additional wrinkle, > because splot does only honor the horizontal > (right/center/left) positioning commands, but > always uses "top" for vertical positioning. > Hence, one needs to modify the vertical position: > > splot sin(x)*cos(y) > set key center at screen \ > GPVAL_KEY_XCENTER/GPVAL_TERM_XSIZE, \ > (GPVAL_KEY_YCENTER+GPVAL_KEY_HEIGHT/2)/GPVAL_TERM_YSIZE > replot > > The commands given above recreate the last position > of the key. By adding/subtracting appropriate values, > one can achieve any desired offset So now I'm confused. I don't see how this addresses the problem you described before, that trivial changes to a key title, the terminal type, etc. can cause the key layout to change. Reproducing the same center position won't help much if the number of columns changes, or even if the whole thing suddenly becomes wider. > The patch is available here, if you want to check > it out: > http://www.philipp-janert.com/keypos.patch Why not put it on the project patch tracker? Ethan |