acsplines fails when weights positive, some data values are 1/0
- From: Nicholas Musolino <n.musolino@xxxxxxxxx>
- Date: Thu, 24 May 2012 15:56:36 -0700 (PDT)
Dear group,
I am trying to plot data using three separate series, depending on the
"x" values (in column 1. I am doing so with data series, using the
ternary operator, for example:
plot "datafile" using 6:( $1 < 35 ? $7/$6 : 1/0) with points ...
That part of my script works fine.
When I try to calculate approximation splines with "smooth acsplines",
this fails with the message,
line 0: Can't calculate approximation splines, all weights
have to be > 0
I am giving it a constant weight in the third column, adding a :(0.5)
or :(0.0001) as a weight.
I looked at the source code in interpol.c, but can't see how the 1/0 y-
value for the data point would cause this message to be thrown.
Here are some facts:
a. "smooth csplines" and "smooth sbezier" work, although they don't
give me the very smooth curve I am looking for.
b. Replacing 1/0 with "NaN" does not change behavior.
c. Changing weight constant (e.g. 1.0, etc.) does not change
behavior.
Below is a minimum working example. I hope the line breaks/spacing
come out cleanly. Please note that I have macros enabled and
linestyles define in my ~/.gnuplot configuration file.
If desired, I can post my PDF output (without splines) or a data file.
Thanks for any help that users can offer!
Nicholas Musolino
example.gnuplot
-------------------
set term postscript enhanced eps
unset key
set xlabel "mean of objective function {/Symbol m}_t (kcal/mol)"
set mxtics 5
set xrange [0:]
set ylabel "rel. std. dev. {/Symbol s}_t / {/Symbol m}_t"
set yrange [0:5.0]
set format y "%.1f"
set mytics 5
stechnique="acsplines"
##w(x)=0.0001;
plot "/home/musolino/rdmr_three/div_analysis/gen1-88_scor.dat" using
6:( $1 < 35 ? $7/$6 :
1/0 ): with points ls 2 pt 6 title "before
consolidation",\
"" using 6:( $1 < 35 ?
$7/$6 : 1/0 ):(0.0001) smooth @stechnique with lines ls 2 lw 1 title
"before consolidation",
"" using 6:( $1>= 35 && $1 < 45 ? $7/$6 :
1/0 )) with points ls 1 pt 28 title "after
consolidation", \
"" using 6:( $1>= 35 && $1 < 45 ? $7/$6 : 1/0 ):
(0.0001) smooth @stechnique with lines ls 1 lw 0.5 title "after
consolidation", \
"" using 6:( $1 >= 45?
$7/$6 : 1/0 ) with points ls 2 pt 7 title "after
second consol.",\
"" using 6:( $1 >= 45?
$7/$6 : 1/0 ):(0.0001) smooth @stechnique with lines ls 2 lw 1 title
"after second consol."
.
- Follow-Ups:
- Re: acsplines fails when weights positive, some data values are 1/0
- From: Hans-Bernhard Bröker
- Re: acsplines fails when weights positive, some data values are 1/0
- From: Nicholas Musolino
- Re: acsplines fails when weights positive, some data values are 1/0
- Prev by Date: Re: how do i set a key (legend) when using “plot with labels”
- Next by Date: Re: acsplines fails when weights positive, some data values are 1/0
- Previous by thread: how do i set a key (legend) when using “plot with labels”
- Next by thread: Re: acsplines fails when weights positive, some data values are 1/0
- Index(es):