|
From: j1n3l0 <nel...@gm...> - 2007-07-19 10:54:22
|
I did solve my problem. I measured the distances for each margin and found
that there is a ratio system in place. My findings are summarised below:
=========================================================================
coords [x, y] = [ (lmargin + (abs(xmin - x)/xrange * xlength)), (tmargin +
(abs(ymax - y)/yrange * ylength)) ]
where:
lmargin is the length in pixels of the left margin
lmargin = 7 * gnuplot lmargin
xrange is the difference between the max and min x values
xrange = abs(xmax - xmin)
xlength is the length of the x axis in pixels
xlength = image_width - (lmargin + rmargin)
tmargin is the length in pixels of the top margin
tmargin = 11 * gnuplot tmargin
yrange is the difference between the max and min y values
yrange = abs(ymax - ymin)
ylength is the length of the y axis in pixels
ylength = image_height - (tmargin + bmargin)
=========================================================================
>From this I was able to construct a class which generates image maps of
Gnuplots on the fly.
Theo Hopman wrote:
>
> 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.
>
This information will be useful in future. I can substitute my methods for
calculating the margins in pixels accordingly.
--
View this message in context: http://www.nabble.com/Is-there-a-way-of-converting-plot-coords-to-graph-coords--tf1832453.html#a11686342
Sent from the Gnuplot - Dev mailing list archive at Nabble.com.
|