Sunday, March 9, 2008

ctioga's non-linear axes

Much as been done on ctioga since the last release, not even two weeks ago: small bug fixes, tangents improvements, the rebirth of a --subplot option, a saner framework for plot styles... But the most significant improvement in my opinion is the possibility to make non-linear axes: you just need to provide a two-ways transformation between the standard coordinates and the axis coordinates, and ctioga does the rest:

ctioga -N --xpdf --math --math-xrange 2:8 \
  'sin(x)' --xaxis bottom --new-axis biniou top \
  --axis-function biniou 1/x 1/x \
  --lines-color biniou Gray --no-title

As you can see, I did profit to add the possibility of background lines corresponding to the axes' major ticks. The only real trick that is left is to find a decent way to partition the target segment so that they ticks are "natural" (not 0.34759, for instance) and reasonably equally spaced. I thought other plotting programs had dealt with this, but in fact, that doesn't seem to be the case: I'll have to do that myself.

No comments: