On 30/04/12 17:00, Daniele Paganelli wrote:
Hi,
I have a problem adjusting the length of a vertical line in Veusz, for
which I need a relative positioning towards x axis. That line works as a
position indicator on the plot, and should go from the x axis y-position
up to the end of the y-axis (se attachment).
So I create a line with a 270 angle and relative positioning towards x,
y axis.
The problem is that the length of that line is always calculated as a
fractional length of the graph width.
In order to obtain a vertical line going from origin y up to maximum y
value, I would have to get height and width of the graph, Ly, Lx and set
the length of the line to L=Ly/Lx.
Lx and Ly are calculated subtracting to the plot width and height the
left+right and up+bottom margins, which, in case they are expressed in
different units, may require a bit of parsing and conversion I think.

It seems unnecessarily difficult... isn't there a more direct way which
I'm missing?

It's not a great API is it? Maybe we need an alternative form for the line for doing x1,y1 -> x2,y2 in axis and/or fractional coordinates.

However, a workaround is to set the line to be longer than you need and set the clip property to be True. This is only in the development version, however.

Another idea is to use a function for doing the plotting of the line. Plot the function x=const.

Jeremy

_______________________________________________
Veusz-discuss mailing list
Veusz-discuss@gna.org
https://mail.gna.org/listinfo/veusz-discuss

Répondre à