|
From: Ethan A M. <sf...@us...> - 2016-04-01 17:38:18
|
On Friday, 01 April, 2016 14:50:12 Nicolas Brouard wrote: > > > Le 1 avr. 2016 à 05:35, sfeam <sf...@us...> a écrit : > > > > I have placed a patchset on SourceForge that introduces a general mechanism > > for defining nonlinear axes in a plot. > > > > https://sourceforge.net/p/gnuplot/patches/728/ > > > > Demos here: > > > > http://skuld.bmsc.washington.edu/~merritt/gnuplot/#nonlinear > > > > It uses the linked-axis mechanism of forward and reverse mappings introduced > > in the "set link {axis} via f(x) inverse g(x)" command with the major > > difference that it links a non-linear visible axis with a hidden axis that is > > always linear. > > > > One motivation is to eventually replace the current implementation of > > logscale axes with something that is both more general and less expensive. > > The effect of the existing command > > set logscale x > > can be achieved by the new command > > set nonlinear x via log10(x) inverse 10**x > > > > A major advantage over the existing logscale implementation is that > > coordinates are not transformed on input. The current logscale > > code stores the log of the true coordinate, which then requires that > > every single reference to that coordinate throughout the core gnuplot > > code is mediated by macros AXIS_DO_LOG, AXIS_UNDO_LOG, AXIS_LOG_VALUE, > > etc. Every time the coordinate is needed we check whether it was > > stored as the log, unlog it if so, do whatever it was we wanted, > > then reapply the log for comparison with other stored values. > > By contrast the new nonlinear axis code simply stores the original > > coordinate value. The nonlinear mapping (log in this case) is only > > needed when we map it to a position on the output terminal canvas. > > > > The log()/exp() transform is an example of a nonlinear axis mapping, > > but the new code is happy to accept other transforms as well. > > This defines a probability plot axis: > > set nonlinear x via norm(x) inverse invnorm(x) > > See demo "probably_tux.dem". [snip] > > Hi, > I haven’t looked at the patch yet but my dream was to have a logit scale implemented in Gnuplot. > Some years (decade?) ago, I gave up because of the y-axis notation which of course should be implemented as for the log scale (.001 0.01 0.99 .999 etc). > Would your patch do this? I think that would be logit(p) = log(p/(1-p)) logistic(a) = 1. / (1. + exp(-a)) set nonlinear y via logistic(y) inverse logit(y) plot [.001:.999] logit(x) title "should be a straight line" I don't use either the logit or probit conventions in my own work so I may have the desired forward/reverse settings backwards. Can you suggest a nice data-driven demo using logit scale? Or point me to a published graph that uses it? If the ascii art from "set term dumb" survives, the output of the above commands is shown here: 4 +---+---+----+---+---+---+---+----+---+----- 3 + ***+ 2 + logit(x) ******* *** + | ** | | ** | 1 + ** + | *** | | *** | | *** | | *** | 0 + *** + | *** | | *** | | *** | | *** | -1 + ** + | ** | | ** | -2 + *** + -3 +*** + -4 +---+---+----+---+---+---+---+----+---+----- 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 Ethan |