« Return to Thread: Adding some new transformations to gnuplot (arctan and power laws)

Re: Adding some new transformations to gnuplot (arctan and power laws)

by Ethan Merritt :: Rate this Message:

Reply to Author | View in Thread

On Tuesday 02 June 2009 06:26:47 Dean Foster wrote:
> If all calls to points go through the function AXIS_MAP and
> AXIS_UNMAP, then it does seem that we are pretty close to being able
> to do a late change of axis.  

They are currently macros, not functions.
I do think that in order to pursue this we will have to change them
to be functions.

Yes, my earlier email with sample code equivalent to
   xx = (FIRST_X_AXIS.transform) ? (FIRST_X_AXIS.transform)(pos->x) : pos->x;
   *x = AXIS_MAP(FIRST_X_AXIS, xx);
would be further simplified by placing the test for a transform inside
AXIS_MAP() itself.

> I didn't know how to check that these
> functions were always used.  (I'm mostly a C++ programmer--so my only
> tricks of making things private to find who peeks at data doesn't work
> here.  But I'm sure someone else knows if these functions are always
> used as go-betweens.)  I can try using them for my transformation and
> see if it seems to work.

I grepped for use of ->term_scale as a convenient indicator, and found only
two other place in the core code that would be affected. One is the tic
placement code, which we've already agreed is a special case but maybe not
impossible to clean up. The other is
  graphics.c:  map_position_r()

As already mentioned, the mousing code in various terminals would need to
revised also, but that will have to be done on a case by case basis.

A few places test for the _sign_ of  (axis)->term_scale,  but so long as
the transform is monotonic that should be OK.  If it isn't monotonic, then
we have other problems starting with there being no 1-to-1 inverse transform.
I'm going to have to think about that, however.  Is it possible that allowing
non-monotonic axis transforms would be another way of generating parametric
plots?

--
Ethan A Merritt

------------------------------------------------------------------------------
OpenSolaris 2009.06 is a cutting edge operating system for enterprises
looking to deploy the next generation of Solaris that includes the latest
innovations from Sun and the OpenSource community. Download a copy and
enjoy capabilities such as Networking, Storage and Virtualization.
Go to: http://p.sf.net/sfu/opensolaris-get
_______________________________________________
gnuplot-beta mailing list
gnuplot-beta@...
https://lists.sourceforge.net/lists/listinfo/gnuplot-beta

 « Return to Thread: Adding some new transformations to gnuplot (arctan and power laws)