Sponsored Content
Top Forums Shell Programming and Scripting GnuPlot-area marked by filledcurve Post 302643621 by bakunin on Sunday 20th of May 2012 05:14:34 AM
Old 05-20-2012
I don't know if the following code is meant to be GNUplot-internal commands or shell commands. I don't use GNUplot. If it is the former the thread should be transferred to Unix and Linux Applications/ as it is applications-related.

As long as i don't know i will treat the following as shell code.

Quote:
Originally Posted by IMPe
Code:
#Sektor Inden --> Anfang <--> Ende
SIa(x)=212
[....]
plot 'PATH/mete.txt' using 1:3 t 'WR' w l lt 3 lw 1 lc rgbcolor "#0000ff", \
    SIa(x) w l lt 3 lw 1 lc rgbcolor "#800080",\
    SIe(x) w l lt 3 lw 1 lc rgbcolor "#800080",\
    SHa(x) w filledcurve above y1=64 l lt 3 lw 1 lc rgbcolor "#800080",\
    SHe(x) w filledcurve below y1=122 l lt 3 lw 1 lc rgbcolor "#800080"

The first line is faulty because shell variables can't be named that way and "SIa(x)" is not a valid name. Have a look at the man page of the shell you are using (most likely man ksh or man bash) abount which characters are allowed and which aren't.

The second line uses (again!) variables without expanding them, as you have been told already in this thread.

If you want to use arrays (which is possible in ksh) you have to do it this way:

Code:
var[1]="abc"             # definition
var[2]="def"
var[3]="ghi"

echo ${var[1]}           # usage 1 - fixed indexes
echo ${var[2]}
string="${var[1]}${var[2]}"

i=1                      # usage 2 - indexed by a variable
while [ $i -le 3 ] ; do
      echo ${var[$i]}
     (( i += 1 ))
done

# specialities: handle the complete array

number_of_elements=${#var[*]}
echo $number_of_elements

echo "print whole arrays content: " ${var[@]}
echo "print whole arrays content: " ${var[*]}

I hope this helps.

bakunin
 

7 More Discussions You Might Find Interesting

1. Post Here to Contact Site Administrators and Moderators

Moderators area?

. (1 Reply)
Discussion started by: Driver
1 Replies

2. UNIX for Dummies Questions & Answers

Help with gnuplot

Hi, I am a beginner using UNIX, and was wondering how to use gnuplot from UNIX on my pc. I am connected remotely to my work's UNIX server using Secure Shell Client, and gnuplot won't open a new window when I use the plot command. How do I do this? Moreover, is it possible to save things from the... (0 Replies)
Discussion started by: KTTFB64
0 Replies

3. UNIX for Dummies Questions & Answers

file marked unretrievable

Hi When i try to ftp download a file from a Solaris 10 server, it returns the error "is marked unretrievable" how can i get around this to download the file? (2 Replies)
Discussion started by: arielgoldberg
2 Replies

4. SuSE

SLES11 - RAID6 all disks marked as Spare

Hello, After a replacement of the motherboard of my server, all disks belonging to a raid6 are now marked as spare. Is there any way to mark those disks as active and restore the raid6? $ cat /proc/mdstat Personalities : md1 : inactive sda1(S) sdk1(S) sdj1(S) sdi1(S) sdh1(S)... (0 Replies)
Discussion started by: xavix
0 Replies

5. UNIX for Dummies Questions & Answers

Area of a square

I am just starting out with bash scripting. I tried a simple script to find the area of a square and it didnt run. #!/bin/bash #script to find area of a square based on user input if then echo " Usage -$0 x " echo " where x is the dimension of the square " exit 1 n1=$1 ... (2 Replies)
Discussion started by: SnydeMz
2 Replies

6. UNIX for Advanced & Expert Users

Superblock marked dirty

Good morning! I met a problem on a FS with AIX 5.3 It's not possible to mount the FS because of a dirty superblock. I tried few things without success. I need your help to solve my problem guys. Do you have any idea please? Thanks a lot drp01,/home/root # mount /GSPRES/data Replaying... (9 Replies)
Discussion started by: Castelior
9 Replies

7. Web Development

Mysql table is marked as crashed and should be repaired

140312 13:43:54 /usr/libexec/mysqld: Table './***/phpbb_posts' is marked as crashed and should be repaired Its mysqld.log in var/log alot of messages, but before around hour i tried to "repaid table" from within phpmyadmin, but appears it has no effect.. why? How to fix? (1 Reply)
Discussion started by: postcd
1 Replies
All times are GMT -4. The time now is 07:43 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy