|
From: Theo H. <th...@ph...> - 2007-07-14 00:35:03
|
j1n3l0 wrote:
>
> Hans-Bernhard Bröker wrote:
>> Ethan Merritt wrote:
>>> Do we have a utility routine somewhere that would convert
>>> plot coordinates to graph or screen coordinates?
>> No. axis.h:AXIS_MAP() and AXIS_MAPBACK transform from data
>> ('first'/'second') coordinates to terminal coordinates and back.
>> Going from terminal to 'screen' is trivial (just divide by term->xmax).
>> Transforming to 'graph' from data coordinates is quite easy: it's a
>> direct linear transformation using the axis_array[].min and .max
>> values.
>>
>
> This thread is over a year old but I am in need of a solution. I am trying
> to get the screen coordinates from my graph coordinates so I can generate an
> image map of my plots.
>
> Is there a way to find out the values of {l|t|b|r}margins in pixels?
> Currently the best I can do is use the "show margin" command, which just
> tells me that the values are computed automatically, not what the values
> are. If I knew the absolute values of these (in pixels) I could find the
> coordinates of each point on my graph.
>
> I think this would go some way to helping me solve my problem.
I'm not sure if it completely solves your problem, but new in 4.3 is a
feature that allows margins to be specified in terms of fractions of the
screen coordinate system. Since you presumably know the size of your
terminal's "screen", you can easily find where the borders of the graph
area are. This method will not work if you need (for whatever reason) to
have automatically calculated margins.
THeo
|