|
From: ZoltánVörös <zv...@gm...> - 2009-12-08 21:15:49
|
Dear All, Some time ago, four terminal variables, GPVAL_TERM_XMIN, GPVAL_TERM_XMAX, GPVAL_TERM_YMIN, and GPVAL_TERM_YMAX were introduced, but there is not too much documentation on them. Could someone enlighten me about the meaning of these, and in particular, whether I can use them to convert axis coordinates to screen coordinates and vice versa? Thanks, Zoltán |
|
From: Thomas S. <t.s...@fz...> - 2009-12-09 08:26:25
|
plotting into a bitmap terminal like 'gif' and analysing the resulting plot file in an appropriate viewer shows that these are the coordinates of the graphs corners. ZoltánVörös wrote: > > Dear All, > > Some time ago, four terminal variables, GPVAL_TERM_XMIN, GPVAL_TERM_XMAX, > GPVAL_TERM_YMIN, and GPVAL_TERM_YMAX were introduced, but there is not too > much > documentation on them. Could someone enlighten me about the meaning of > these, > and in particular, whether I can use them to convert axis coordinates to > screen > coordinates and vice versa? > Thanks, > Zoltán > > > ------------------------------------------------------------------------------ > Return on Information: > Google Enterprise Search pays you back > Get the facts. > http://p.sf.net/sfu/google-dev2dev > _______________________________________________ > gnuplot-info mailing list > gnu...@li... > https://lists.sourceforge.net/lists/listinfo/gnuplot-info > > -- View this message in context: http://old.nabble.com/What-is-the-meaning-of-the-terminal-variables--tp26700899p26706697.html Sent from the Gnuplot - User mailing list archive at Nabble.com. |
|
From: ZoltánVörös <zv...@gm...> - 2009-12-09 08:59:18
|
> > plotting into a bitmap terminal like 'gif' and analysing the resulting > plot file in an appropriate viewer shows that these are the coordinates > of the graphs corners. Dear Thomas, Thanks, this I have already done, but I would like to have something firmer. Also, what would it mean, if I had a 3D plot, where the graph corner is somewhat ill-defined? Surely, there must be some conversion formula for this. I have tried to track it in the code, but it is not obvious where it is. Cheers, Zoltán > > ZoltánVörös wrote: > > > > Dear All, > > > > Some time ago, four terminal variables, GPVAL_TERM_XMIN, GPVAL_TERM_XMAX, > > GPVAL_TERM_YMIN, and GPVAL_TERM_YMAX were introduced, but there is not too > > much > > documentation on them. Could someone enlighten me about the meaning of > > these, > > and in particular, whether I can use them to convert axis coordinates to > > screen > > coordinates and vice versa? > > Thanks, > > Zoltán |
|
From: Thomas S. <t.s...@fz...> - 2009-12-09 10:07:59
|
the variables GPVAL_TERM_XMIN, GPVAL_TERM_XMAX, GPVAL_TERM_YMIN, GPVAL_TERM_YMAX give the corners of the graph in pixels. (you need version 4.4) together with the information in GPVAL_X_MIN, GPVAL_X_MAX, ... it should be easy to translate data point coordinates into pixels and vice-versa. the fact that there are no GPVAL_TERM_ZMIN, GPVAL_TERM_ZMAX variables indicates that the above variables are no meant for 3d-plots. ZoltánVörös wrote: > > >> >> plotting into a bitmap terminal like 'gif' and analysing the resulting >> plot file in an appropriate viewer shows that these are the coordinates >> of the graphs corners. > > Dear Thomas, > > Thanks, this I have already done, but I would like to have something > firmer. > Also, what would it mean, if I had a 3D plot, where the graph corner is > somewhat > ill-defined? Surely, there must be some conversion formula for this. I > have > tried to track it in the code, but it is not obvious where it is. > Cheers, > Zoltán > >> >> ZoltánVörös wrote: >> > >> > Dear All, >> > >> > Some time ago, four terminal variables, GPVAL_TERM_XMIN, >> GPVAL_TERM_XMAX, >> > GPVAL_TERM_YMIN, and GPVAL_TERM_YMAX were introduced, but there is not >> too >> > much >> > documentation on them. Could someone enlighten me about the meaning of >> > these, >> > and in particular, whether I can use them to convert axis coordinates >> to >> > screen >> > coordinates and vice versa? >> > Thanks, >> > Zoltán > > > ------------------------------------------------------------------------------ > Return on Information: > Google Enterprise Search pays you back > Get the facts. > http://p.sf.net/sfu/google-dev2dev > _______________________________________________ > gnuplot-info mailing list > gnu...@li... > https://lists.sourceforge.net/lists/listinfo/gnuplot-info > > -- View this message in context: http://old.nabble.com/What-is-the-meaning-of-the-terminal-variables--tp26700899p26707829.html Sent from the Gnuplot - User mailing list archive at Nabble.com. |
|
From: ZoltánVörös <zv...@gm...> - 2009-12-09 12:31:49
|
Thomas Sefzick <t.sefzick <at> fz-juelich.de> writes: > > > the variables > GPVAL_TERM_XMIN, GPVAL_TERM_XMAX, > GPVAL_TERM_YMIN, GPVAL_TERM_YMAX > give the corners of the graph in pixels. > (you need version 4.4) > > together with the information in > GPVAL_X_MIN, GPVAL_X_MAX, ... > it should be easy to translate data point coordinates into > pixels and vice-versa. Yes, this is clear, but what you state above is not correct: if I do this plot sin(x) on a wxt terminal, then I get this GPVAL_TERM_XMIN = 1215 GPVAL_TERM_XMAX = 12394 GPVAL_TERM_YMIN = 678 GPVAL_TERM_YMAX = 7355 while my window is only 640 X 380 pixels. I think, the number of pixels is multiplied by 20, and that gives GPVAL_TERM_XMIN and the like. But is this 20 a universal number? If I change to a different terminal, can I still trust my numbers? Cheers, Zoltán |
|
From: Thomas S. <t.s...@fz...> - 2009-12-09 15:40:05
|
those interactive terminals use an internal screen of a fixed
size which is then scaled to fit into the actual canvas window.
e.g. X11:
GPVAL_TERM_XMIN = 285
GPVAL_TERM_XMAX = 4000
GPVAL_TERM_YMIN = 236
GPVAL_TERM_YMAX = 4019
always nearly the same values (differ a little bit due to some
adjustments of the margins because the font size is not scaled),
regardless of the actual window size and aspect ratio.
if you plot into an x11 terminal, look at the GPVAL_TERM_*
variables, then change the plot window size with the mouse,
replot (is needed to change the variables), and look at the
variables again, you will see that there is not much change.
i think this applies to the wxt terminal in a similar way, but i
don't have a wxt terminal here, so i can't test it.
the scaling factors (internal canvas <-> canvas window on
screen) are not fixed but depend on the actual window
shape, and they are not accessible via to GPVAL_* variables.
simple bitmap terminals (e.g. gif) are different, here the
pixels are mapped 1:1.
ZoltánVörös wrote:
>
> Thomas Sefzick <t.sefzick <at> fz-juelich.de> writes:
>
>>
>>
>> the variables
>> GPVAL_TERM_XMIN, GPVAL_TERM_XMAX,
>> GPVAL_TERM_YMIN, GPVAL_TERM_YMAX
>> give the corners of the graph in pixels.
>> (you need version 4.4)
>>
>> together with the information in
>> GPVAL_X_MIN, GPVAL_X_MAX, ...
>> it should be easy to translate data point coordinates into
>> pixels and vice-versa.
>
> Yes, this is clear, but what you state above is not correct: if I do this
>
> plot sin(x)
>
> on a wxt terminal, then I get this
> GPVAL_TERM_XMIN = 1215
> GPVAL_TERM_XMAX = 12394
> GPVAL_TERM_YMIN = 678
> GPVAL_TERM_YMAX = 7355
>
> while my window is only 640 X 380 pixels. I think, the number of
> pixels is multiplied by 20, and that gives GPVAL_TERM_XMIN and
> the like. But is this 20 a universal number? If I change to a
> different terminal, can I still trust my numbers?
> Cheers,
> Zoltán
>
>
> ------------------------------------------------------------------------------
> Return on Information:
> Google Enterprise Search pays you back
> Get the facts.
> http://p.sf.net/sfu/google-dev2dev
> _______________________________________________
> gnuplot-info mailing list
> gnu...@li...
> https://lists.sourceforge.net/lists/listinfo/gnuplot-info
>
>
--
View this message in context: http://old.nabble.com/What-is-the-meaning-of-the-terminal-variables--tp26700899p26712247.html
Sent from the Gnuplot - User mailing list archive at Nabble.com.
|
|
From: ZoltánVörös <zv...@gm...> - 2009-12-09 16:10:44
|
> those interactive terminals use an internal screen of a fixed > size which is then scaled to fit into the actual canvas window. > > e.g. X11: > GPVAL_TERM_XMIN = 285 > GPVAL_TERM_XMAX = 4000 > GPVAL_TERM_YMIN = 236 > GPVAL_TERM_YMAX = 4019 > always nearly the same values (differ a little bit due to some > adjustments of the margins because the font size is not scaled), > regardless of the actual window size and aspect ratio. > if you plot into an x11 terminal, look at the GPVAL_TERM_* > variables, then change the plot window size with the mouse, > replot (is needed to change the variables), and look at the > variables again, you will see that there is not much change. Greetings Thomas, Many thanks for your effort! I still feel a bit uncomfortable with this situation. > > i think this applies to the wxt terminal in a similar way, but i > don't have a wxt terminal here, so i can't test it. I believe, it is 1:20 on wxt. At least, this is what I measured. After rescaling the terminal with the mouse, I got quite different numbers. My problem is the following: I would like to draw a circle based on three points on it. I can read out the mouse variables, but those are given as axis coordinates. However, what if I want to use the mouse coordinates to draw a circle with respect to the screen? I understand that the circle requires axis coordinates, but only for the position. I mean, if I want to draw a circle based on coordinates that I get by clicking the mouse three times, then I have to have some means of converting between the screen and the axes. Is there a way to do that? Cheers, Zoltán |
|
From: Thomas S. <t.s...@fz...> - 2009-12-09 20:14:10
|
the factor for the wxt-terminal is 20, in 'gnuplot/src/wxterminal/gp_cairo.h': /* oversampling scale */ #define GP_CAIRO_SCALE 20 if you read out the mouse coordinates in axis units, you may convert these to '20*pixel' units using GPVAL_TERM_* and GPVAL_X/Y_*. then you may generate the circles coordinates and convert back to axis units, specifying the center and the radius in x-axis units. ZoltánVörös wrote: > >> those interactive terminals use an internal screen of a fixed >> size which is then scaled to fit into the actual canvas window. >> >> e.g. X11: >> GPVAL_TERM_XMIN = 285 >> GPVAL_TERM_XMAX = 4000 >> GPVAL_TERM_YMIN = 236 >> GPVAL_TERM_YMAX = 4019 >> always nearly the same values (differ a little bit due to some >> adjustments of the margins because the font size is not scaled), >> regardless of the actual window size and aspect ratio. >> if you plot into an x11 terminal, look at the GPVAL_TERM_* >> variables, then change the plot window size with the mouse, >> replot (is needed to change the variables), and look at the >> variables again, you will see that there is not much change. > > Greetings Thomas, > > Many thanks for your effort! I still feel a bit uncomfortable > with this situation. > >> >> i think this applies to the wxt terminal in a similar way, but i >> don't have a wxt terminal here, so i can't test it. > > I believe, it is 1:20 on wxt. At least, this is what I measured. > After rescaling the terminal with the mouse, I got quite different > numbers. > > My problem is the following: I would like to draw a circle based on > three points on it. I can read out the mouse variables, but those are > given as axis coordinates. However, what if I want to use the mouse > coordinates to draw a circle with respect to the screen? I understand > that the circle requires axis coordinates, but only for the position. > I mean, if I want to draw a circle based on coordinates that I get by > clicking the mouse three times, then I have to have some means of > converting between the screen and the axes. Is there a way to do that? > Cheers, > Zoltán > > > ------------------------------------------------------------------------------ > Return on Information: > Google Enterprise Search pays you back > Get the facts. > http://p.sf.net/sfu/google-dev2dev > _______________________________________________ > gnuplot-info mailing list > gnu...@li... > https://lists.sourceforge.net/lists/listinfo/gnuplot-info > > -- View this message in context: http://old.nabble.com/What-is-the-meaning-of-the-terminal-variables--tp26700899p26716877.html Sent from the Gnuplot - User mailing list archive at Nabble.com. |
|
From: ZoltánVörös <zv...@gm...> - 2009-12-09 20:34:19
|
> the factor for the wxt-terminal is 20, > in 'gnuplot/src/wxterminal/gp_cairo.h': > > /* oversampling scale */ > #define GP_CAIRO_SCALE 20 > > if you read out the mouse coordinates in axis units, you may > convert these to '20*pixel' units using GPVAL_TERM_* and > GPVAL_X/Y_*. > then you may generate the circles coordinates and convert > back to axis units, specifying the center and the radius in > x-axis units. Many thanks, Thomas! I think this situation is far from ideal, because it is not portable in any sense of the term (pun intended here:), but what the heck! Zoltán |