On Sun, Apr 26, 2009 at 8:53 PM, Alan W. Irwin
<ir...@beluga.phys.uvic.ca> wrote:
> I suggest you go ahead and implement any improvement you would like to see
> in PLplot axis scaling. Of course, be sure and test such improvements for
> all anticipated QSAS axis scaling needs.

Would it be considered reasonable to some form of user-customizable
axis labeling API in PLplot by providing callbacks similar to the pltr
functions used by plcont and friends?  The axis labeling code could
remain mostly as-is.  However, when a custom labeling function is
defined, rather than rendering the text which matches the actual
number at a given axis location, that number would be passed to the
user-provided function.  This function would return a string with the
appropriate label based on the provided floating point value.  If the
user wants to capture extra label information in this function (scale
magnitude, for example) they could do so.

Something along the lines of (pseudo-code):

---
function geo_label_x x:
  if x > 0 then "abs(x) E"
  else if x < 0 then "abs(x) W"
  else "0"

function geo_label_y y:
  if y < 0 then "abs(y) S"
  else if y > 0 then "abs(y) N"
  else "Equator"

plset_axis_label_funcs(geo_label_x, geo_label_y)
---

>From here, rather than the axis labels for (-5, -5) being rendered as
"-5" and "-5", then would be rendered as "5 W" and "5 S" respectively.

I have something along these lines in place for the OCaml PLplot
bindings, though I am still getting the code cleaned up before
releasing it.  Having this or something similar as a part of core
PLplot would, I think, be useful.  It could be used for time axes
(either separate from or in conjunction with the new time handling
code in PLplot), lat/lon labeling or other custom labeling purposes.

If this approach is deemed acceptable I would be happy to help as much
as I am able with the implementation.

Hez

-- 
Hezekiah M. Carty
Graduate Research Assistant
University of Maryland
Department of Atmospheric and Oceanic Science

------------------------------------------------------------------------------
Crystal Reports &#45; New Free Runtime and 30 Day Trial
Check out the new simplified licensign option that enables unlimited
royalty&#45;free distribution of the report engine for externally facing 
server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
Plplot-devel mailing list
Plplot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plplot-devel

Reply via email to