[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [XForms] axes coords in XYPlot

From: Michal Szymanski
Subject: Re: [XForms] axes coords in XYPlot
Date: Thu, 19 May 2011 16:42:54 +0200
User-agent: Mutt/

On Thu, May 19, 2011 at 02:23:47PM +0200, Jens Thoms Toerring wrote:
> Hi Michael,
> On Wed, May 18, 2011 at 05:11:52PM +0200, Michal Szymanski wrote:
> > I thought it should be trivial but it seems not to be so. Unless I am
> > missing something hidden.
> > 
> > set/get x/ybounds routines deal with data clipping. Surely, the XYPlot axes
> > do change then also but due to tic rounding (which is mentioned in the
> > manual) the clipping values are not the same as axes coords.
> > 
> > Is there a way to get X,Y coords of the XYPlot axes? With the auto-adjusted
> > margins this seems to be a tricky thing to get without digging into some
> > internals. And, obviously, the library must have these values. 
> Sorry for not being able to answer yet, the xyplot object is
> really not one of the easiest to understand;-) There are that
> many scale factors and cases involved that I haven't yet un-
> derstood what's going on in there yet (and there also seem
> to luk some bugs someone else has reported). I'm still in
> the process of trying to find my way through the whole mess.
> So, due to my lack of understanding of what's going on in there
> (and perhaps also misunderstanding your question): did you try
> to use fl_get_xyplot_xmapping() and fl_get_xyplot_ymapping()
> and use just the last argument? As far as I understand it at
> the moment, these should be the x and y screen coordinates of
> the origin of the axes system.

Not really, I am afraid. These functions return a and b coeffs for

  screenCoord = a * data + b    or, after small rearrangement
  data = (screenCoord - b) / a

But the screenCoord is the standard X11 coordinate of a point in the
current form window, measured from the top left corner. Even if the XYPlot
were the only object in the form window (and it is usually not), the (0,0)
screenCoords would not be the coordinates of the upper left corner of the
XYPlot axes (due to the presence of margins for ticks and axes labels).

What I want to get are the coordinates (be it screen or "world" - the above
mentioned routines allow to convert between the two systems) of the corners
of the plot where the axes cross (well, they do not actuall cross, but
contact each other).

I hope I made it clear this time.

regards, Michal.

PS. From what I was able to find in the xyplot.c and private/pxyplot.h
the screen coords of the "corners" might be defined by xi,xf yi,yf
members of the FLI_XYPLOT_SPEC structure describing the xyplot.

  Michal Szymanski (msz at astrouw dot edu dot pl)
  Warsaw University Observatory, Warszawa, POLAND

reply via email to

[Prev in Thread] Current Thread [Next in Thread]