|
From: Daniel J S. <dan...@ie...> - 2006-05-28 14:26:27
|
Hans-Bernhard Br=F6ker wrote:
>> The only problem is choosing the plot range and samples correctly so=20
>> that the discontinuity ends up being selected. =20
>=20
>=20
> No. The problem is that tuning of equidistant sampling can typically=20
> only be done to match *one* discontinuity --- but there's no way of=20
> telling how many discontinuities a plotted function might have in the=20
> plotted range, or where they'll be.
I had in mind each subrange could be treated with the same number of poin=
ts and not get too elaborate. If it is oversampling on one region, so be=
it. (In essence, pretty much the same behavior of the parametric mode e=
xample you give.)
>=20
>> OK, well, then here is something else that would make plotting=20
>> discontinuities a little nicer. Say f(x) is defined as above
>>
>> f(x) =3D x<1?0:1/x
>>
>> and I were able to plot subranges in my plot
>>
>> plot [x=3D-1:1-epsilon] f(x) with lines lc rgb "red", [x=3D1+epsilon:4=
]=20
>> f(x) with lines lc rgb "red"
>=20
>=20
> You *are* able to do that, once you switch to parametric mode.
>=20
> set parametric
> set trange [0:1-epsilon]
> x1(t)=3D-1+2*t
> x2(t)=3D1+3*t
> plot x1(t),f(x1(t)), x2(t), f(x2(t))
Oh yeah, parametric mode. (All the possibilities!) I will include this =
for a couple examples then, thanks.
I still think
plot [-1:1-eps,1:3] pareto(x), [-1:4] cos(x)
would be nicer. Granted, parametric works.
>=20
>> the plotting process 1-epsilon is basically cast to 1.0. (BTW, why=20
>> does putting the range in the plot override the "set xrange [#,#]"=20
>> command? =20
>=20
>=20
> Because that's what _all_ optional elements of a 'plot' command do, in=20
> gnuplot: they override whatever the default for some property of the=20
> plot might be. 'with <style>' overrides 'set style function' or 'set=20
> style data', 'linetype <n>' overrides the colour, and a range overrides=
=20
> the corresponding 'set *range'.
Well, that was my line of thinking. When I say
plot x ls 4, x**2
the line style of 4 applies *only* to the first graph. It does not apply=
to all the graphs on the plot. But I guess since {xrange} is before all=
the functions it could be argued it should apply to all functions.
Dan
|