On Japanese BBS, partial sample range specification is requested in parametric mode. For example,
set parametric
set trange [-pi:pi]
plot t,sin(t), [0:pi] t cos(t)
would draw a sin's graph for [-pi:pi] and a cos's graph for [0:pi].
I don't understand the code for range specification in plot2d.c well, but attached patch seems to do so.
I will look at the patch.
In version 5 this kind of plot does not require parametric mode.
Instead you can use the pseudofile '+':
That works in both versions 5.0 and 5.2 with no patches needed.
Last edit: Ethan Merritt 2018-04-10
Thanks for your reply.
I know such workaround. It is for parametric mode he want to do.
Unfortunately I think that the current version of the patch is not complete enough to apply.
One part is easy to fix: there is no need to copy and restore the entire axis_array[SAMPLE_AXIS] structure. It is sufficient to save and restore sampling_range_token.
The more difficult problem is that most of the sample and partial range code in plot2d.c is in the sections handling data plots rather than function plots. The initialization, mapping, and cleanup of the sampling axis structures is incomplete for a function plot.
For example, if you add a third plot to your test case:
you will see that the 3rd plot inherits the partial range from the second plot rather than using the original xrange or trange. Adding "set trange" or "set xrange" does not change this.
Another problem is that the code to prepare axis properties like logscale is not called. The failure is demonstrated by
It is not simple to fix these problems. I think it is a better solution to use the data-plotting mode with '+' instead of parametric mode.