I have killed a day, trying to understand what I am doing
wrong, but cannot figure it out. I generate what I though
were well formed driver files for gnuplot, and data files for
each driver file to eat. But I get this:
[herrold@... gnuplot]$ gnuplot gnu-BA.gnu
Segmentation fault
[herrold@... gnuplot]$ patch -R < no-segfault-gnu-BA.gnu.patch
patching file gnu-BA.gnu
[herrold@... gnuplot]$ gnuplot gnu-BA.gnu
{the graphical display is fine - screenshot sample at:
http://www.herrold.com/gnu-BA.gnu-patched.png }
[herrold@... gnuplot]$
The corrective patch (I think) is simply directing output to a
display, rather than a file [sorry about the use of -R -- I
diffed the wrong way]:
[herrold@... gnuplot]$ cat no-segfault-gnu-BA.gnu.patch
--- gnu-BA.gnu 2005-10-03 16:46:44.752310790 -0400
+++ gnu-BA.gnu~ 2005-10-03 16:46:44.751311123 -0400
@@ -1,5 +1,5 @@
-# set term png
-# set out 'BA.png'
+set term png
+set out 'BA.png'
set title "-| BA (BOEING CO, NYSE) -- 2005 10 3 |-"
set label 1 "BA: PC:67.95 O:67.57 H:68 L:67.13 C:67.84 V:17758 T:2177 on: 200510 3 " at graph 0.10, graph 0.9 left
front
set style line 1 lt 1 lw 2
@@ -39,4 +39,4 @@
set format y "%1.0f"
plot 'BA.txt' using 5:13 notitle with impulses lt 3
unset multiplot
-pause mouse
+# pause mouse
[herrold@... gnuplot]$
The version which works seems unremarkable to me:
[herrold@... gnuplot]$ cat gnu-BA.gnu
# set term png
# set out 'BA.png'
set title "-| BA (BOEING CO, NYSE) -- 2005 10 3 |-"
set label 1 "BA: PC:67.95 O:67.57 H:68 L:67.13 C:67.84 V:17758 T:2177 on: 2005 10 3 " at graph 0.10, graph 0.9 left front
set style line 1 lt 1 lw 2
set style line 2 lt 3 lw 2
set style line 3 lt 3 lw 3
set style arrow 1 head filled size screen 0.03,15 ls 1
set style arrow 2 head filled size screen 0.03,15 ls 2
set style arrow 3 head filled size screen 0.03,15 ls 3
set yrange [67.0865: 68.0435]
set ytics 67.13, 0.16 , 68
set xrange [510:1020]
set xtics (540, 600, 660, 720, 780, 840, 900, 960)
set grid
set multiplot
set lmargin 9
set rmargin 2
set format x ""
set size 1,0.7
set origin 0.0, 0.3
set bmargin 0
set arrow 1 from 520,67.95 to 570,67.57 as 1
set label 2 "Gap down " at graph 0.10, graph 0.85 left front
plot 'BA.txt' using 5:9:10:11:12 notitle with candlesticks
unset label 1
unset label 2
unset arrow 1
unset title
set xtics ("9:00" 540, "10:00" 600, "11:00" 660, "12:00" 720, "13:00" 780,"14:00" 840, "15:00" 900, "16:00" 960)
set bmargin
set format x
set grid
set size 1.0, 0.3
set origin 0.0, 0.0
set tmargin 0
set ytics 0, 80 , 336
set yrange [0:400]
set format y "%1.0f"
plot 'BA.txt' using 5:13 notitle with impulses lt 3
unset multiplot
pause mouse
[herrold@... gnuplot]$
but my hope was to build a marked image up on the fly, similar
to the fine example at John Bollinger's work at:
http://www.equitytrader.com/
which is featured at:
http://gnuplot.sourceforge.net/demo_4.1/finance.html
[Thanks, John]
The driver data is produced from a database extract, and is
all well-formed:
[herrold@... gnuplot]$ head BA.txt
2005 10 3 09:23:00 563 0 BA 4 67.57 67.6 67.57 67.59 26 67.58
2005 10 3 09:24:00 564 0 BA 16 67.58 67.6 67.55 67.6 80 67.57
2005 10 3 09:25:00 565 0 BA 3 67.59 67.62 67.59 67.61 26 67.61
2005 10 3 09:26:00 566 0 BA 2 67.63 67.63 67.62 67.62 12 67.62
2005 10 3 09:27:00 567 0 BA 8 67.58 67.62 67.58 67.59 28 67.6
2005 10 3 09:28:00 568 0 BA 8 67.57 67.59 67.57 67.58 36 67.58
2005 10 3 09:29:00 569 0 BA 7 67.55 67.57 67.54 67.57 23 67.55
2005 10 3 09:30:00 570 1 BA 10 67.56 67.57 67.51 67.55 38 67.53
2005 10 3 09:40:00 580 1 BA 2 67.51 67.55 67.51 67.55 9 67.54
2005 10 3 09:41:00 581 1 BA 3 67.76 67.81 67.76 67.77 54 67.8
[herrold@... gnuplot]$
The underlying 'gnuplot' being used is from mainline Centos (a
Red hat Enterprise Linux rebuild project):
[herrold@... gnuplot]$ rpm -qi gnuplot
Name : gnuplot Relocations: (not relocatable)
Version : 4.0.0 Vendor: CentOS
Release : 4 Build Date: Mon 21 Feb 2005 06:21:02 PM EST
Install Date: Fri 05 Aug 2005 02:17:15 PM EDT Build Host: bhrama.build.karan.org
Group : Applications/Engineering Source RPM: gnuplot-4.0.0-4.src.rpm
Size : 3077545 License: Redistributable, with restrictions
Signature : DSA/SHA1, Sat 26 Feb 2005 03:44:16 PM EST, Key ID a53d0bab443e1821
Packager : Karanbir Singh <kbsingh@...>
URL : http://www.gnuplot.info/
Summary : A program for plotting mathematical expressions and data.
Description :
Gnuplot is a command-line driven, interactive function plotting
program especially suited for scientific data representation. Gnuplot
can be used to plot functions and data points in both two and three
dimensions and in many different formats.
Install gnuplot if you need a graphics package for scientific data
representation.
======================
What am I doing wrong?
-- Russ Herrold
|