How to plot a multicolum file in gnuplot - colors

I am having a multicoulum file and after certain rows it has a row break.
It looks like
# SET: 1
0.00000 -62.49368 0.07000
0.00639 -62.49367 0.07000
0.01276 -62.49367 0.07000
0.01914 -62.49366 0.07000
0.02553 -62.49365 0.07000
0.03190 -62.49364 0.07000
0.03829 -62.49362 0.07000
0.04467 -62.49361 0.07000
0.05106 -62.49359 0.07000
0.05743 -62.49356 0.07000
# SET: 2
0.00000 -62.49342 0.07000
0.00639 -62.49342 0.07000
0.01276 -62.49341 0.07000
0.01914 -62.49340 0.07000
0.02553 -62.49339 0.07000
0.03190 -62.49338 0.07000
0.03829 -62.49337 0.07000
0.04467 -62.49335 0.07000
# SET: 3
0.00000 -62.47334 0.07000
0.00639 -62.47225 0.07000
0.01276 -62.47228 0.07000
0.01914 -62.47231 0.07000
0.02553 -62.47236 0.07000
0.03190 -62.47242 0.07000
0.03829 -62.47248 0.07000
0.04467 -62.47256 0.07000
0.05106 -62.47264 0.07000
0.05743 -62.47273 0.07000
0.06381 -62.47283 0.07000
0.07020 -62.47296 0.07000
0.07657 -62.47296 0.07000
and so on.
My plot is produced using
plot 'data' u 1:2 w l lc 2
The y-axis data are around zero from some negative to positive scale alining along x-axis.
I want to make top line just below the zero and just above the zero (horizontal line at Y=0 at) with different colour.
The data set which is to be plotted near to Y=0 (along x-axis) from data file looks like ($2 will flip the sign from negative to positive)
# SET: 38
0.00000 -0.88752 0.07000
0.00639 -0.88731 0.07000
0.01276 -0.88751 0.07000
0.01914 -0.88783 0.07000
0.02553 -0.88827 0.07000
0.03190 -0.88884 0.07000
0.03829 -0.88954 0.07000
0.04467 -0.89036 0.07000
0.05106 -0.89132 0.07000
0.05743 -0.89240 0.07000
# SET: 39
0.00000 2.02394 0.07000
0.00639 2.02456 0.07000
0.01276 2.02642 0.07000
0.01914 2.02950 0.07000
0.02553 2.03379 0.07000
0.03190 2.03927 0.07000
0.03829 2.04590 0.07000
0.04467 2.05364 0.07000
0.05106 2.06264 0.07000
0.05743 2.07248 0.07000
0.06381 2.08330 0.07000
0.07020 2.09494 0.07000
0.07657 2.10755 0.07000
So basically I want to make the both the lines colorful which changes the sign at colum 2 from negative to positive. The line can be grepped using awk and grep commands and can be seen that after which SET $2 changes from negative to positive and then that SET index can be used in gnuplot to make the line colorful.
Unfortunately I do not know how to do it.
Hope I have explained it nicely. Please let me know if I need to clarify it more.

If I understand you correctly you want to have the line in one color (e.g. red 0xff0000) when the value in column 2 is smaller zero and and another color (e.g. green 0x00ff00) if it is larger zero. Simply define a function which returns a color code in the form of 0xRRGGBB.
Maybe something like this?
(If you are plotting from file skip the part $Data <<EOD ... EOD and in the plot command replace $Data with your filename, e.g. 'MyFile.dat'.
Code:
### color dependent on column value
reset session
$Data <<EOD
# SET: 38
0.00000 -0.88752 0.07000
0.00639 -0.88731 0.07000
0.01276 -0.88751 0.07000
0.01914 -0.88783 0.07000
0.02553 -0.88827 0.07000
0.03190 -0.88884 0.07000
0.03829 -0.88954 0.07000
0.04467 -0.89036 0.07000
0.05106 -0.89132 0.07000
0.05743 -0.89240 0.07000
# SET: 39
0.00000 2.02394 0.07000
0.00639 2.02456 0.07000
0.01276 2.02642 0.07000
0.01914 2.02950 0.07000
0.02553 2.03379 0.07000
0.03190 2.03927 0.07000
0.03829 2.04590 0.07000
0.04467 2.05364 0.07000
0.05106 2.06264 0.07000
0.05743 2.07248 0.07000
0.06381 2.08330 0.07000
0.07020 2.09494 0.07000
0.07657 2.10755 0.07000
EOD
myColor(n) = n<0 ? 0xff0000 : 0x00ff00
plot $Data u 1:2:(myColor($2)) w lp pt 7 lc rgb var notitle
### end of code
Result:
Addition:
After clarification in the comments the following might be a possible solution.
You plot your data into a dummy table and check which is the last set which has column2-values smaller than zero. column(-1) contains the number of the set (counting starts from zero). Check also help pseudocolumns.
You modify your color function a bit and take the colors from an array.
Tested with gnuplot 5.2.6.
Code:
### color dependent on column value
reset session
# create some random test data
set print $Data
Sets = 30
GapPos = int(rand(0)*Sets/3)+Sets/3
GapSize = 3
f(x) = (x-GapPos)+rand(0)*0.5 + (x>=GapPos ? GapSize : 0)
do for [i=1:Sets] {
print "# SET: ".i
do for [j=1:10] {
print sprintf("%.4f %.4f", (j+rand(0))/10., f(i))
}
print "\n"
}
set print
# find the SET-no. where column 2 values change from negative to positive
set table $Dummy
plot $Data u (SetNo = $2<0 ? column(-1)+1 : SetNo) with table
unset table
# set the colors
array ArrColors[6] = [0xff0000, 0x00ff00, 0x0000ff, 0xff00ff, 0xffff00, 0x00ffff]
myColor(n) = n<SetNo-3 || n>=SetNo+3? 0xcccccc : ArrColors[n-SetNo+4]
plot $Data u 1:2:(myColor(column(-1))) w lp pt 7 lc rgb var notitle
### end of code
Result:

Related

Gnuplot - How to join smoothly ordered points?

I've a set of data in three columns:
1st column: order criterion between 0 and 1
2nd: x vals
3rd: y vals
As a data file example:
0.027 -29.3 -29.6
0.071 -26.0 -31.0
0.202 -14.0 -32.8
0.304 -3.4 -29.3
0.329 -0.5 -26.0
0.409 6.7 -14.0
0.458 11.7 -3.4
0.471 12.8 -0.5
0.495 12.5 6.7
0.588 18.8 11.7
0.600 20.4 12.8
0.618 20.8 12.5
0.674 20.9 18.8
0.754 22.1 20.4
0.810 27.0 20.8
0.874 24.7 20.9
0.892 9.4 22.1
0.911 -11.5 27.0
0.943 -23.7 24.7
0.962 -29.6 9.4
0.991 -31.0 -11.5
0.999 -32.8 -23.7
My goal is to plot (x,y) points and a trend curve passing through each points ordered in ascending order with the first column values.
I use the following script:
set terminal png small size 600,450
set output "my_data_mcsplines_joined_points.png"
set table "table_interpolation.dat"
plot 'my_data.dat' using 2:3 smooth mcsplines
unset table
plot 'my_data.dat' using 2:3:(sprintf("%'.3f", $1)) with labels point pt 7 offset char 1,1 notitle ,\
"table_interpolation.dat" with lines notitle
Here mcspline results as an example:
mcspline joined points figure
The resulting curve should have the shape of a spindle or a loop.
Whatever smooth options used, Gnuplot seems invalid to handle such aim.
Unfortunatly most of smooth (mcspline, csplines...) options do a monotonic ordering of data.
How can I plot a trend curve passing through each points ordered in ascending order with the first column values?
Thanks.
I cannot post an image in a comment, and so place it here. I don't think a 2D plot will be sufficient, based on this 3D acatterplot of the data in your question.

Gnuplot date on x axis and missing data

I am trying to make a chart of data, which depends on time. I have this data:
01/1851 NaN 0.812 0.862 0.735 2.19
02/1851 NaN 1.739 1.733 1.695 1.875
03/1851 NaN 1.472 1.376 1.458 3.31
04/1851 NaN 1.847 1.775 1.828 6.06
05/1851 4.48 2.038 1.762 2.125 7.695
06/1851 10.06 0.347 0.276 0.383 5.48
07/1851 6.67 0.402 0.323 0.395 9.76
08/1851 3.21 1.57 1.469 1.421 8.62
09/1851 1.78 2.64 2.616 2.589 10.075
10/1851 3.7 1.269 1.314 1.137 4.295
11/1851 7.62 6.206 6.236 6.058 8.87
I need to make a chart of all this columns in one chart. Problem is, that date is monthly, and some values are NaN (not a number) which should not be ploted, but it says "all points y value undefined!" when i do this
set xdata time
gnuplot> set timefmt "%m/%y"
gnuplot> set xrange ["01/1851":"12/2014"]
gnuplot> set format x "%m/%y"
gnuplot> set timefmt "%m/%y"
gnuplot> plot "milesovka.txt" u 2:3
Can somebody help me? I tried this even ix excel, but i doesn't take dates before 1900.
Why do you specify u 2:3? You then wouldn't have a date on the x-axis.
This seems to work fine:
set xdata time
set timefmt "%m/%Y"
set format x "%m/%Y"
plot for [i=2:6] "milesovka.txt" u 1:i ti "Column ".i w lp

"with labels" in splot causes gnuplot crash

Well, not really crash, but a kind of infinite loop: gnuplot doesn't react.
I' m trying to have a contour plot from a datafile, with labels on each contour line. Here's my gnuplot code:
set key at screen 1, 0.9, 0 right top vertical Right noreverse enhanced autotitle nobox
set view map
unset surface
set isosamples 50, 50
set contour base
set cntrparam bspline
set cntrparam order 8
set cntrparam levels discrete -25,-50,-100,-150,-300,-500
set style data lines
set title "plot"
set xlabel "Temps (ns)"
set xrange [ * : * ] noreverse nowriteback
set ylabel "T_e"
set yrange [ * : * ] noreverse nowriteback
splot "Hydro-fct-temps.csv" u 1:3:6 lw 2
This code works fine, but if I replace the splot line with (as I've seen in http://gnuplot.sourceforge.net/demo_5.0/contours.html):
splot "Hydro-fct-temps.csv" u 1:3:6 lw 2, "Hydro-fct-temps.csv" u 1:3:6 with labels boxed
then gnuplot doesn't plot anything, and I only can get the prompt with a ctrl-c. The data file is something like :
#Time [ns] N_e [1/cc] T_e [eV] Z Rho [gr/cc] Pos [um]
0.000000e+00 0.000000e+00 0.000000e+00 4.100000e+01 8.500000e+00 0.000000e+00
0.000000e+00 0.000000e+00 0.000000e+00 4.100000e+01 8.500000e+00 4.579648e-03
0.000000e+00 0.000000e+00 0.000000e+00 4.100000e+01 8.500000e+00 9.191354e-03
0.000000e+00 0.000000e+00 0.000000e+00 4.100000e+01 8.500000e+00 1.383534e-02
Any idea to help me? Thanks!
Edit: I'm on Mac OS 10.11.4, using Gnuplot 5.0.3, aqua terminal

Gnuplot Charts Wild Fluctuations

I have a simple chart plotting off CSV data. Recently, there have been some wild fluctuations in the chart that I can't explain.
The chart:
The data:
"YYYY-MM-DD HH:MM:SS.SS","Pressure","Pressure Normal","Basement Temp","Downstairs Temp","Energy C1","Energy C2","Garage Temp","Lux","Lux Low","Indoor Hum","Main Attic Hum","Main Attic Temp","Outdoor Hum","Outdoor Temp","Outdoor Freeze","Rain Today","Septic Pump","Target Hum","Target Hum Low","Target Hum High","Upstairs Temp","Septic Low","Septic High","Wind Direction","Wind Speed"
2015-10-29 22:00:01.017000,29.95,30,68.0,69.0,639.986,381.38,45.0,0.0,30,49.0,39.0,49.0,94.0,46.0,32,0.0,176.884,45,15,45,66.0,165,185,139,2.0
2015-10-29 22:15:00.858000,29.96,30,68.0,69.0,526.95,283.151,45.0,0.0,30,49.0,39.0,48.9,92.0,46.0,32,0.0,178.132,45,15,45,67.0,165,185,146,2.0
2015-10-29 22:30:00.767000,29.96,30,68.0,68.0,462.525,362.072,45.0,0.0,30,49.0,39.0,48.8,92.0,46.0,32,0.0,178.654,45,15,45,66.0,165,185,138,5.0
2015-10-29 22:45:00.836000,29.97,30,68.0,68.0,473.075,274.232,45.0,0.0,30,49.0,39.0,48.4,91.0,46.0,32,0.0,179.509,45,15,45,66.0,165,185,147,2.0
2015-10-29 23:00:01.729000,29.98,30,68.0,68.0,460.024,355.895,45.0,0.0,30,49.0,39.0,48.3,89.0,46.0,32,0.0,179.626,45,15,45,66.0,165,185,150,2.0
2015-10-29 23:15:01.481000,29.99,30,68.0,68.0,470.404,266.078,44.0,0.0,30,49.0,39.0,48.1,90.0,46.0,32,0.0,179.759,45,15,45,66.0,165,185,140,1.0
2015-10-29 23:30:00.948000,29.99,30,67.0,67.0,578.765,361.633,44.0,0.0,30,49.0,39.0,48.1,90.0,45.0,32,0.0,181.606,45,15,45,65.0,165,185,143,0.0
2015-10-29 23:45:00.978000,29.99,30,67.0,67.0,578.813,265.008,44.0,0.0,30,48.0,39.0,47.7,90.0,45.0,32,0.0,180.662,45,15,45,65.0,165,185,143,0.0
2015-10-30 00:00:01.018000,30.0,30,67.0,67.0,571.851,358.56,44.0,0.0,30,48.0,39.0,47.6,90.0,45.0,32,0.0,182.406,45,15,45,65.0,165,185,154,0.0
2015-10-30 00:15:00.703000,30.0,30,67.0,67.0,461.92,266.449,44.0,0.0,30,48.0,40.0,47.5,90.0,45.0,32,0.0,179.058,45,15,45,65.0,165,185,170,1.0
2015-10-30 00:30:00.676000,30.0,30,68.0,67.0,459.044,364.956,44.0,0.0,30,48.0,40.0,47.3,90.0,45.0,32,0.0,176.376,45,15,45,65.0,165,185,152,1.0
2015-10-30 00:45:01.742000,30.0,30,67.0,67.0,464.856,268.456,44.0,0.0,30,49.0,40.0,47.2,90.0,45.0,32,0.0,178.552,45,15,45,65.0,165,185,160,0.0
2015-10-30 01:00:01.412000,30.0,30,67.0,67.0,462.717,373.676,44.0,0.0,30,48.0,40.0,47.0,91.0,45.0,32,0.0,177.563,45,15,45,65.0,165,185,140,1.0
2015-10-30 01:15:01.398000,30.0,30,67.0,66.0,465.183,265.674,44.0,0.0,30,48.0,40.0,46.9,91.0,45.0,32,0.0,179.081,45,15,45,64.0,165,185,139,1.0
2015-10-30 01:30:01.690000,30.0,30,67.0,66.0,466.075,276.496,43.0,0.0,30,48.0,40.0,46.8,91.0,45.0,32,0.0,178.243,45,15,45,64.0,165,185,125,0.0
2015-10-30 01:45:01.222000,30.01,30,67.0,66.0,583.214,266.92,43.0,0.0,30,48.0,40.0,46.5,90.0,45.0,32,0.0,179.797,45,15,45,64.0,165,185,125,0.0
2015-10-30 02:00:01.147000,30.02,30,67.0,66.0,577.097,265.52,43.0,0.0,30,48.0,40.0,46.3,90.0,45.0,32,0.0,180.246,45,15,45,64.0,165,185,161,0.0
2015-10-30 02:15:01.130000,30.03,30,67.0,66.0,570.447,268.758,43.0,0.0,30,48.0,40.0,46.2,92.0,45.0,32,0.0,181.472,45,15,45,64.0,165,185,140,0.0
2015-10-30 02:30:01.124000,30.03,30,67.0,66.0,466.977,266.9,43.0,0.0,30,48.0,40.0,46.1,92.0,44.0,32,0.0,179.358,45,15,45,64.0,165,185,157,0.0
2015-10-30 02:45:00.935000,30.03,30,67.0,66.0,467.547,265.461,43.0,0.0,30,47.0,40.0,45.7,92.0,44.0,32,0.0,178.06,45,15,45,64.0,165,185,148,0.0
2015-10-30 03:00:00.730000,30.04,30,67.0,65.0,467.852,270.395,42.0,0.0,30,48.0,41.0,45.5,91.0,44.0,32,0.0,180.963,45,15,45,64.0,165,185,148,0.0
2015-10-30 03:15:00.669000,30.05,30,67.0,65.0,470.797,269.087,42.0,0.0,30,48.0,41.0,45.1,91.0,43.0,32,0.0,181.562,45,15,45,64.0,165,185,148,0.0
2015-10-30 03:30:00.597000,30.06,30,67.0,65.0,471.425,266.515,41.0,0.0,30,48.0,41.0,44.7,91.0,43.0,32,0.0,181.108,45,15,45,64.0,165,185,148,0.0
2015-10-30 03:45:01.544000,30.06,30,67.0,65.0,466.103,266.759,41.0,0.0,30,48.0,41.0,44.6,92.0,42.0,32,0.0,181.674,45,15,45,65.0,165,185,148,0.0
2015-10-30 04:00:01.428000,30.06,30,67.0,65.0,468.903,269.099,41.0,0.0,30,48.0,41.0,44.4,92.0,42.0,32,0.0,181.132,45,15,45,64.0,165,185,148,0.0
2015-10-30 04:15:01.112000,30.07,30,67.0,64.0,1133.93,265.94,40.0,0.0,30,48.0,41.0,44.0,92.0,42.0,32,0.0,178.97,45,15,45,63.0,165,185,148,0.0
2015-10-30 04:30:01.129000,30.08,30,67.0,65.0,575.551,269.082,40.0,0.0,30,48.0,41.0,43.8,94.0,41.0,32,0.0,179.605,45,15,45,64.0,165,185,143,0.0
2015-10-30 04:45:00.949000,30.08,30,67.0,64.0,2912.436,342.048,40.0,0.0,30,48.0,41.0,43.7,95.0,42.0,32,0.0,179.017,45,15,45,64.0,165,185,168,0.0
2015-10-30 05:00:00.969000,30.09,30,67.0,66.0,550.604,279.568,40.0,0.0,30,49.0,41.0,44.8,95.0,42.0,32,0.0,177.197,45,15,45,68.0,165,185,184,2.0
2015-10-30 05:15:00.709000,30.1,30,67.0,66.0,586.835,549.631,40.0,0.0,30,49.0,41.0,45.4,95.0,41.0,32,0.0,178.466,45,15,45,69.0,165,185,148,1.0
2015-10-30 05:30:00.901000,30.1,30,67.0,66.0,596.532,278.354,39.0,0.0,30,49.0,41.0,46.1,95.0,41.0,32,0.0,175.013,45,15,45,70.0,165,185,161,1.0
2015-10-30 05:45:01.672000,30.1,30,67.0,65.0,1506.813,1119.999,39.0,0.0,30,50.0,41.0,46.2,95.0,41.0,32,0.0,174.623,45,15,45,67.0,165,185,155,0.0
2015-10-30 06:00:01.509000,30.12,30,68.0,67.0,1516.573,266.874,39.0,0.0,30,49.0,41.0,46.6,95.0,41.0,32,0.0,175.143,45,15,45,69.0,165,185,155,0.0
2015-10-30 06:15:01.207000,30.12,30,68.0,68.0,1072.979,376.114,39.0,0.0,30,49.0,41.0,46.7,95.0,41.0,32,0.0,172.09,45,15,45,69.0,165,185,155,0.0
2015-10-30 06:30:01.312000,30.12,30,69.0,70.0,854.998,281.418,38.0,0.0,30,49.0,41.0,46.6,95.0,40.0,32,0.0,172.968,45,15,45,69.0,165,185,155,0.0
2015-10-30 06:45:01.234000,30.12,30,69.0,69.0,596.209,374.564,38.0,0.0,30,49.0,41.0,45.1,95.0,40.0,32,0.0,174.648,45,15,45,68.0,165,185,155,0.0
2015-10-30 07:00:00.883000,30.12,30,68.0,68.0,596.669,279.735,38.0,0.0,30,49.0,41.0,44.5,95.0,40.0,32,0.0,175.019,45,15,45,67.0,165,185,155,0.0
2015-10-30 07:15:01.066000,30.12,30,68.0,68.0,489.209,376.154,38.0,0.0,30,49.0,41.0,44.0,96.0,41.0,32,0.0,175.471,45,15,45,66.0,165,185,155,0.0
2015-10-30 07:30:01.019000,30.12,30,68.0,67.0,398.586,269.955,38.0,0.0,30,49.0,41.0,43.5,96.0,41.0,32,0.0,178.401,45,15,45,66.0,165,185,155,0.0
2015-10-30 07:45:00.784000,30.12,30,68.0,67.0,397.613,369.828,37.0,0.0,30,49.0,42.0,42.8,96.0,41.0,32,0.0,176.625,45,15,45,66.0,165,185,155,0.0
2015-10-30 08:00:00.919000,30.13,30,67.0,67.0,394.231,284.606,37.0,0.0,30,48.0,42.0,42.6,96.0,41.0,32,0.0,176.026,45,15,45,65.0,165,185,155,0.0
2015-10-30 08:15:00.672000,30.14,30,67.0,66.0,403.669,373.851,37.0,0.0,30,48.0,42.0,42.4,96.0,41.0,32,0.0,180.215,45,15,45,65.0,165,185,156,0.0
2015-10-30 08:30:00.527000,30.13,30,67.0,66.0,391.887,268.734,37.0,0.0,30,48.0,42.0,42.5,96.0,42.0,32,0.0,172.674,45,15,45,65.0,165,185,146,0.0
2015-10-30 08:45:01.630000,30.13,30,67.0,66.0,388.044,265.381,38.0,0.0,30,48.0,43.0,43.8,97.0,42.0,32,0.0,174.12,45,15,45,65.0,165,185,125,1.0
2015-10-30 09:00:01.461000,30.14,30,67.0,66.0,506.085,263.921,38.0,0.0,30,49.0,43.0,44.7,97.0,42.0,32,0.0,174.449,45,15,45,65.0,165,185,36,0.0
2015-10-30 09:15:01.443000,30.15,30,67.0,66.0,515.15,270.162,39.0,0.0,30,48.0,43.0,45.7,97.0,43.0,32,0.0,173.922,45,15,45,65.0,165,185,342,0.0
2015-10-30 09:30:01.428000,30.16,30,67.0,66.0,503.095,266.903,39.0,0.0,30,48.0,43.0,46.8,97.0,44.0,32,0.0,179.962,45,15,45,64.0,165,185,53,0.0
2015-10-30 09:45:01.175000,30.16,30,67.0,66.0,406.591,268.547,40.0,0.0,30,48.0,43.0,49.3,97.0,45.0,32,0.0,180.893,45,15,45,64.0,165,185,286,1.0
2015-10-30 10:00:01.024000,30.17,30,67.0,66.0,408.512,267.207,41.0,0.0,30,48.0,43.0,50.8,97.0,46.0,32,0.0,182.111,45,15,45,64.0,165,185,240,1.0
The script (run on Gnuplot 5.0 patch 0):
#! /usr/bin/env gnuplot
reset
#### Stats and Setup ####
set terminal pngcairo enhanced background "#000000" font "Arial,10" size 400,200 truecolor
datafile_temperatures_indoor = "/Users/username/Dropbox/Public/charts.csv"
set datafile separator ','
stats datafile_temperatures_indoor using 2 nooutput
set timefmt "%Y-%m-%d %H:%M:%S"
set output "/Users/username/Dropbox/Public/TemperaturesIndoor.png"
now = time(0)
today_midnight = strptime('%Y-%m-%d', strftime('%Y-%m-%d', now))
#### Plot Parameters and Styles ####
set tics textcolor rgb "#666666"
set border linetype rgb "#666666"
set boxwidth 0.25 relative
set style fill solid 1.0
set style line 1 linetype rgb "#FFFFFF" linewidth 1 pointtype 6 # white
set style line 2 linetype rgb "#333333" linewidth 1 pointtype 6 # light gray
set style line 3 linetype rgb "#666666" linewidth 1 pointtype 6 # gray
set style line 4 linetype rgb "#999999" linewidth 1 pointtype 6 # dark gray
set style line 5 linetype rgb "#000000" linewidth 1 pointtype 6 # black
set style line 6 linetype rgb "#FF3333" linewidth 1 pointtype 6 # red
set style line 7 linetype rgb "#FF6600" linewidth 1 pointtype 6 # orange
set style line 8 linetype rgb "#FFFF00" linewidth 1 pointtype 6 # yellow
set style line 9 linetype rgb "#336600" linewidth 1 pointtype 6 # green
set style line 10 linetype rgb "#0000FF" linewidth 1 pointtype 6 # blue
set style line 11 linetype rgb "#000033" linewidth 1 pointtype 6 # indigo
set style line 12 linetype rgb "#6600FF" linewidth 1 pointtype 6 # violet
#### Key Parameters ####
set nokey
#### X Axis Parameters ####
unset mxtics
set xdata time
set xrange [now - 72*60*60 : now]
set xtics 72*60*60, 24*60*60 format "%a" nomirror
#### Y Axis Parameters ####
set ytics format "%2.0f" nomirror
#### Plot the Data ####
plot datafile_temperatures_indoor using 1:4 every ::2 title column with lines smooth csplines linestyle 8,\
datafile_temperatures_indoor using 1:5 every ::2 title column with lines smooth csplines linestyle 12,\
datafile_temperatures_indoor using 1:22 every ::2 title column with lines smooth csplines linestyle 6
The stats:
* FILE:
Records: 319
Out of range: 0
Invalid: 0
Blank: 0
Data Blocks: 1
* COLUMN:
Mean: 66.3856
Std Dev: 1.7577
Sample StdDev: 1.7605
Skewness: 0.5592
Kurtosis: 2.5369
Avg Dev: 0.9624
Sum: 21177.0000
Sum Sq.: 1.40683e+06
Mean Err.: 0.0984
Std Dev Err.: 0.0696
Skewness Err.: 0.1371
Kurtosis Err.: 0.2743
Minimum: 63.0000 [ 25]
Maximum: 71.0000 [267]
Quartile: 65.0000
Median: 66.0000
Quartile: 67.0000
I don't see an out of range value in the data; sometimes the out of range obs is wildly negative (-60), sometimes wildly positive +240). I'm wondering if there's a bug in the implementation of csplines under 5.0. Any advice would be most appreciated.
Cheers.
[EDIT] With mcsplines:
With Bezier (which I think I prefer):

Gnuplot Graph Is Disjointed (Data Seems Shifted/Misordered)

Gnuplot gives me the following picture with an odd disjoint in the second graph, whose origin I cannot determine. I've included the data below, in which the x-values are monotonically increasing, which should rule out the possibility of such a disjoint. Any help appreciated!
Generated from the following script:
set size 0.8,0.4
set lmargin 1
set terminal png
set output "test.png"
set multiplot
set origin 0.1,0.1
set xtics 5
set xrange[0:25]
set xlabel "Year"
plot "./g1" u ($1+1):2 w lines t "4 years"
set xlabel ""
set origin 0.1,0.5
set xtics format ""
set x2tics 5
plot "./g2" u ($1+1):2 w lines t "5 years"
unset multiplot
Data for g1 is:
0.000000 1.000000
1.000000 3.000000
2.000000 9.000000
3.000000 27.000000
4.000000 0.809131
5.000000 2.427394
6.000000 7.282183
7.000000 21.846549
8.000000 0.654694
9.000000 1.964081
10.000000 5.892243
11.000000 8.935199
12.000000 0.529733
13.000000 1.589200
14.000000 3.983240
15.000000 2.509780
16.000000 0.428624
17.000000 1.233139
18.000000 1.951804
19.000000 0.595792
20.000000 0.343980
21.000000 0.809600
22.000000 0.729229
23.000000 0.171423
24.000000 0.258384
25.000000 0.426250
Data for g2 is:
0.000000 1.000000
1.000000 3.000000
2.000000 9.000000
3.000000 27.000000
4.000000 81.000000
5.000000 2.427394
6.000000 7.282183
7.000000 21.846549
8.000000 65.539647
9.000000 196.618942
10.000000 5.892243
11.000000 17.676730
12.000000 53.030190
13.000000 159.090569
14.000000 241.250367
15.000000 14.302798
16.000000 42.908394
17.000000 128.725182
18.000000 322.642448
19.000000 203.292210
20.000000 34.718531
21.000000 104.155593
22.000000 299.652772
23.000000 474.288428
24.000000 144.777335
25.000000 84.275565
That's strange. On my system (ubuntu 11.10 64bit) I don't see the problem you have:
$ gnuplot --version
gnuplot 4.4 patchlevel 3
$ gnuplot < a.gnuplot # a.gnuplot is your script, unmodified
And it produces this:
If I were you I'd check:
gnuplot version
The input files - in vim use set list to see if there's any rampant characters hidden

Resources