#1291 Different scaling of GPVAL_TERM_* variables.

closed-fixed
nobody
None
5
2015-03-23
2013-10-02
No

Hi,

I wanted to calculate the margins after a plot command. The right margin should be GPVAL_TERM_XMAX/(1.0*GPVAL_TERM_XSIZE).

But that works only for a few terminals, others have an internal oversampling, which gets included in e.g. GPVAL_TERM_XMAX, but not in e.g. GPVAL_TERM_XSIZE:

set terminal wxt
plot sin(x)
print sprintf('right margin at screen %f', GPVAL_TERM_XMAX/(1.0*GPVAL_TERM_XSIZE))

set terminal pdfcairo
set output '/dev/null'
plot sin(x)
print sprintf('right margin at screen %f', GPVAL_TERM_XMAX/(1.0*GPVAL_TERM_XSIZE))

That prints:

right margin at screen 0.962422
right margin at screen 0.047778

Tested with 4.6.0 and 4.7 (2013-09-23).

Would it be ok to scale GPVAL_TERM_XSIZE also by this oversampling factor, or would it break something?

Thanks,
Christoph

Discussion

  • Ethan Merritt

    Ethan Merritt - 2014-07-30
    • status: open --> pending-accepted
     
  • Ethan Merritt

    Ethan Merritt - 2014-07-30

    As of today, 4.6 and 5.0 both report the current terminal scale factor in GPVAL_TERM_SCALE.

    So right margin in fractional coordinates is
    GPVAL_TERM_XMAX * GPVAL_TERM_SCALE * 1.0 / GPVAL_TERM_XSIZE

     
    Last edit: Ethan Merritt 2014-07-30
  • Ethan Merritt

    Ethan Merritt - 2014-08-15
    • status: pending-accepted --> closed-fixed
     
  • Christoph Bersch

    Great, thank you for adding this. I attached a small patch to include the GPVAL_TERM_SCALE in an example in the docs.

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks