Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

smooth option with log log plot

367 views
Skip to first unread message

Shailendra

unread,
Jul 19, 2008, 12:00:57 AM7/19/08
to
Hi All,
I face a problem when i use "smooth cspline" option with "set log xy
". I get some strange wiggle in the curve even if u just by seeing the
data plot you can see it is quite smoothly varying. I am posting the
data below.
Y X
26001.010748 0.010000
4281.268838 0.020000
1403.321122 0.030000
623.920780 0.040000
329.886993 0.050000
195.100466 0.060000
124.802095 0.070000
84.602694 0.080000
59.971387 0.090000
44.045245 0.100000
5.694855 0.200000
1.706694 0.300000
0.724142 0.400000
0.372038 0.500000
0.215795 0.600000
0.136117 0.700000
0.091300 0.800000
0.064185 0.900000
0.046827 1.000000
0.005874 2.000000
0.001742 3.000000
0.000735 4.000000
0.000377 5.000000
0.000218 6.000000
0.000137 7.000000
0.000092 8.000000
0.000065 9.000000
0.000047 10.000000

If you just plot the data in log-log scale it looks nice but if i use
smooth cspline it looks ugly. you get wiggle at the point when the
scale jump. Please let me know if there is work around or solution to
it. I guess if i take log of data and than smooth it than i should get
a smooth curve but i want that to be last option.

Thanks,
Shailendra

goo...@catking.net

unread,
Jul 20, 2008, 7:40:58 AM7/20/08
to
Yes, " it looks nice " , I think it looks quite nice with a squiggle
as well.

You should avoid vague terms like " it looks nice " and try to be
clear and precise.

Can you please explain exactly what you think smooth csplines should
do and what is incorrect with the results you get. It looks correct to
me.

If you can explain what you expect a cspline to do, I can explain
where you are mistaken.


regards.

goo...@catking.net

unread,
Jul 24, 2008, 1:35:48 PM7/24/08
to
This seems like yet another user looking for some kind of averaging
type smoothing and only finding csplines.

I believe this is a fundemental flaw in gnuplot.

csplines defines a curve that goes through all data points without
discontinous changes in direction.

As can be seen by plotting the data provided above, this can give
unexpected excursions outside the range of the data points.

What I guess the user was looking for was some smoothing that would
give less weight to the data lying away from the fairly clearly
defined straight line, not exagerate the excusions.

Sadly this does not currently exist.

I think some such smoothing should be provided or (if the reply is
that gnuplot is not for data processing) then csplines should be
removed.

regards.


Ethan Merritt

unread,
Jul 24, 2008, 2:36:17 PM7/24/08
to
In article <7388ede8-9e5a-4280...@n33g2000pri.googlegroups.com>,

<goo...@catking.net> wrote:
>This seems like yet another user looking for some kind of averaging
>type smoothing and only finding csplines.
>
>I believe this is a fundemental flaw in gnuplot.
[snip]

>What I guess the user was looking for was some smoothing that would
>give less weight to the data lying away from the fairly clearly
>defined straight line, not exagerate the excusions.
>
>Sadly this does not currently exist.

You do realize that gnuplot has an entire subsystem, "fit",
that will fit any sort of smooth curve you want? Yes, you have
to first decide what is the mathematical form of this curve,
but isn't that exactly what you are asking for?


>
>I think some such smoothing should be provided or (if the reply is
>that gnuplot is not for data processing) then csplines should be
>removed.
>
>regards.
>
>


--
Ethan A Merritt

goo...@catking.net

unread,
Jul 25, 2008, 2:29:27 PM7/25/08
to
On Jul 24, 8:36 pm, merr...@u.washington.edu (Ethan Merritt) wrote:
> In article <7388ede8-9e5a-4280-b704-f7411d695...@n33g2000pri.googlegroups.com>,

Thanks Ethan. Yes I do realise about fit command and the way I would
treat the above data would probably be to fit a straight line but that
is hypothetical without knowing what the data represents.

Fit is fine if there is a prototype function to fit , clearly that is
not always the case.

All that does not really address the basic issue I raised, that
fitting a spline through every point is often not what is required.
There are often data points we would prefer to play down rather than
force an excursion to include.

Fitting a spline to experimental data necessarily containing errors
just does not make sense, as plotting the above data shows.

Clearly what the user was expecting was some kind of mean to smooth
the data. This would not be any harder to compute than fitting a
cspline.

I don't understand the inclusion of splines and the exclusion of other
more standard smoothing techniques.

Thanks for your reply.

Theo Hopman

unread,
Jul 26, 2008, 3:46:48 PM7/26/08
to

As has been mentioned elsewhere, one usually has an idea of how the
data should behave, and can therefore fit a curve to it. Failing that,
you can use approximate cubic splines; see `help acsplines`; these
usually do a good job of drawing a smoothed curve through noisy data.
Of course, it's just a visual aid, since you can't do any kind of
interpolation.

THeo

Shailendra

unread,
Aug 7, 2008, 6:48:09 PM8/7/08
to
Hi All,
I will try to explain the problem once again. I wish i could attach
the graphs to make my point clear.
I am going to mention 2 way of plotting the same information, and i
expect same plot for both case.
Mehtod 1:
--------------
I take the data mention in my previous email.
set log xy
plot <file_name> using 2:1 smooth cspline

Method 2:
-------------
I take the data mentioned in my previous email and take LOG10(Y-axis-
data) and create new file with log10(y) as y-axis
set log x note: no y here
plot <file_name> using 2:1 smooth cspline

I do not get the same plot. Am i wrong in expecting the both method to
give the same plot?

Thanks,
Shailendra

0 new messages