Talk About Network

Google





Graphics > Gnuplot interactive function plotter > gnuplot 4.2 con...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 2 Topic 3505 of 3655
Post > Topic >>

gnuplot 4.2 conditional plotting problem...

by refsvik@[EMAIL PROTECTED] (Kjell Are Refsvik) Sep 11, 2008 at 04:41 PM

Hi, 

I am trying to figure out how to include a conditional plotting
statement in my shell-script, but am failing spectacularly so far.

What I want to do is to include a file to be plotted if it exists, and
if not - plot the ones that is.

Trying to follow the manual:
http://gnuplot.sourceforge.net/docs_4.2/node96.html

..... and including an if-statement in my script:
..
..
..

gnuplot << EOF
set terminal pdf enhanced color fsize 50 size $width,$height  # Output
settings
set output "norway_detailed.pdf"                              # Output
filename
set noxtics                                              # Do not plot
any tics
set noytics             
set angles degrees                            # Define degrees to be the
angles
set nogrid                                    # Do not plot a grid
set noborder                                  # Do not plot a border
set nokey                                     # Do not plot a legend
set pointsize 1                               # Set the sice of the
pencil
set xrange [$low_x:$high_x]                   # Define the region to be
plotted
set yrange [$low_y:$high_y]
set style fill solid 0.25 border -1           # Red 20% red fillcolour
set style line 2 lt 1 lw 20 pt 6              # Linestyle 2: black/think
line

if ($track_exist==1) plot "$sourcemapoverview" with filledcurves lt 1,\
                          "$sourcemapdetailedfeatures" using 1:2:3 with
labels lt 1,\
                          "track.txt" with dots,\
                          "geotagged_photos_numbered.dat" using 2:3:1
with labels lt 6;
else                 plot "$sourcemapoverview" with filledcurves lt 1,\
                          "$sourcemapdetailedfeatures" using 1:2:3 with
labels lt 1,\
                          "geotagged_photos_numbered.dat" using 2:3:1
with labels lt 6

unset size                    # Unset some values to be ready for the
next plot 
unset style line
unset style fill
EOF

..
..
..
(Full script at
http://www.ia-stud.hiof.no/~kjellare/misc/20080910_plotmap.sh)

gives me this:

-----
gnuplot> else plot
"/Users/refsvik/Do***ents/master/programmering/plot_test/norway_shapefil
e2.txt" with filledcurves lt 1,                        
 "/Users/refsvik/Do***ents/master/programmering/plot_test/norway_detaile
d_features.dat" using 1:2:3 with labels lt 1,                        
 "geotagged_photos_numbered.dat" using 2:3:1 with labels lt 6
         ^
         line 0: else without if

node172:Desktop refsvik$ 
-----

I obviously got the if-statement wrong. I would love it if anyone would
point out my flaw, and post it here.

Sincerely,

Kjell Are Refsvik
 




 2 Posts in Topic:
gnuplot 4.2 conditional plotting problem...
refsvik@[EMAIL PROTECTED]  2008-09-11 16:41:47 
Re: gnuplot 4.2 conditional plotting problem...
=?ISO-8859-1?Q?Hans-Bernh  2008-09-11 21:05:51 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
localhost-V2008-12-19 Wed Jan 7 23:36:16 PST 2009.