|
From: Tait <gnu...@t4...> - 2014-04-22 06:13:45
|
> > I think I remember some discussion a while back about changing plot's > > syntax to specify a per-line range for plots. Something akin to: > > set xrange [-10:10] > > plot [0:10] sqrt(x), [-10:0] -log(-x+1) > > > > ... as a substitute for the current approach: > > rangefunc(x,min,max,func)=(x>min)&&(x<=max) ? func : 1/0 > > plot rangefunc(x,0,10,sqrt(x)), rangefunc(x,-10,0,-log(-x+1)) > > > > Did that idea ever go anywhere? > > A variant of this went into CVS more than a year ago. > > http://gnuplot.sourceforge.net/demo_cvs/piecewise.html Okay sorry, I forgot that and didn't find it within the archives I still have handy. > > Since it's backward-incompatible with the current plot [] syntax, it would > > probably have to be a major version change. > > In what way is it incompatible? > I don't recall seeing any reports of breakage. In the current versions (4.6p3 or p5), the initial []-enclosed values are taken as the overall x- and y- range. plot [5:11][3:12] x, x/2+4 is equivalent to set xrange [5:11]; set yrange [3:12]; plot x, x/2+4 and a range like [7:9] before the x/2+4 is a syntax error. Changing this as outlined above (and apparently as-implemented in CVS?) is incompatible because now the [3:12] above would be a syntax error* and the [5:11] would apply only to the x and not to the x/2+4 line, and the overall plot x-range is still presumably at its previous setting, or default [-10:10]. * maybe? I suppose gnuplot could implement a per-line y-range by calculating the point it would draw, then not drawing it if it falls outside the y-range given for that line. |