How To Color Different Lines In Gnuplot

Hi there. My environment is Ubuntu 12.04 OS. I have an example of the files I create with gfortran and gnuplot. The gnuplot draws this picture from a data file with 2D Cartesian coordinates. It is perpective projection. I need to color some parts of the plot (various lines) in different colors because some other details must also be drawn and I feel that the resulting network will be confusing. Gnuplot user manuals treat this subject but only in conjunction with lines drawn through a formula like sin(x), etc. I don't have that. All I have is columns of floating point numbers. Is there way I can draw lines of different color with gnuplot 4.6?

Thanks, - A.


Similar Content



What Happened To Gnuplot?

In my Ubuntu 14.04 something happened to gnuplot app. When I invoke a command gnuplot filename.gnu no canvas is generated. I think it began about a month ago but at that time I worked on this machine via a remote desktop and I thought, mistakenly, that the plot actually was generated on the major machine and I could not see it. I operated at that time via a laptop. So, today is the first day I am testing this software on my desktop and lo and behold no plot is generated.

When command is run Ubuntu does not come to the command prompt. It gets suspended and waits. If I click RETURN button, the command prompt will again appear but where is the plot?

I hope I made my plight clear.

Needles to say I have used gnuplot many times in the past although perhaps in Ubunutu VM which I will test shortly.

I also made sure that gnuplot is installed, trying to do

Quote:
sudo apt-get install gnuplot
The result was that I do have it installed.

What is the problem?

Thanks, - A.

Installing Gnuplot Version 5.0

Hi there. I have a problem installing the newest version of gnuplot which is 5.0. I downloaded it from this website (sourceforge): a source tarball. The Ubuntu 12.04 archive manager in my laptop placed it in the directory /home/alex/gnuplot-5.0.0.tar. I opened the directory/folder with a click and began reading manuals. The install procedure (read INSTALL.gnu) calls for issuing this command:

Quote:
1. `cd' to the directory containing the package's source code and type
`./configure' to configure the package for your system. If you're
using `csh' on an old version of System V, you might need to type
`sh ./configure' instead to prevent `csh' from trying to execute
`configure' itself.
It is impossible to get to the directory gnuplot-5.0.0.tar via a terminal. If I type cd gnuplot-5.0.0.tar it says that this is not a derectory. If I omit .tar it does not recognize the name at all. I tried to rename it but after that I could not open it even with a click.

What shall I do?

Thanks, - A.

ASCII Vs. Binary Files

Trying to work with gnuplot in Ubuntu 12.04 I run into confusing comments about binary vs. ASCII files. Take this as an example for instance. Looking for a good explanation I open this link. It is an outstanding sample of confusion and obfuscation. My own understanding is that binary is an executable file and ASCII is a source file. With gnuplot it is all upside down. I am confused.

Thanks,- A.

Mouse Input To Gnuplot In Ubuntu

Chapter 17 of gnuplot pdf manual (Mouse Input) says "The x11, pm, windows, ggi, and wxt terminals allow interaction with the current plot using the mouse." I wonder if my Ubuntu 13.04 has any of those, if not, then perhaps the three terminals (Terminal, UXTerm, Xterm) I can invoke here, maybe they also have the same property? The proper term is: are they mouse capable? Thanks, - A.

Extract Only Specific Part From A File

Hello All,

I would like to know if there is a better way to achieve the below task:

Task: Copy lines 10 to 50 from a files that contains 100 lines.

My approach:
1st) use head command and then list first 50 lines and then tail last 40 lines.

2nd) Do a while loop with a counter and then when counter reaches to 10 start writing it to another file up to the point where the counter is 50 and then exit.

I would like to know if there are any other simple and straight approach using which I can directly copy lines 10 to 50.

Help and suggestions on this question are greatly appreciated.

Thanks.

New Problem With Aliases

I have many .bashrc aliases. When I used to type in an alias, it just executed the alias. Now something has changed. When I type in the alias, it prints the alias lines and then executes the commands:

alias cde='cd /etc/ && ls --color -a' #get to /etc

root@me~# cde
cd /etc/
ls --color -a
...into /etc and list of folders/files follows...

How can I stop the

cd /etc/
ls --color -a

from being displayed?

Thanks.

Remove Lines That Are Subsets Of Other Lines In File

Hello everyone,


Although it seems easy, I've been stuck with this problem for a moment now and I can't figure out a way to get it done.

My problem is the following:

I have a file where each line is a sequence of IP addresses, example :

Line 1: 10.0.01 10.0.0.2
Line 2 : 10.0.0.5 10.0.0.1 10.0.0.2
...

What I'd like to do, is to remove lines that are completely matched in other lines. In the previous example, "Line 1" would be deleted as it is contained in "Line 2".

So far, I've worked with python and set() objects to get the job done but I've got more than 100K lines and sets lookups are becoming time consuming as the program goes :/

Thanks for you help

Extract Middle Of File - How To Strip Header/footer

I have a log file with a header (which I can skip with awk), and a footer, which I need to find a way to remove. The goal is to extract the middle lines from a file. Specifically, there is a header (1 line) and a footer (1 line).
The only way I can figure out how to do this is if I already know how many lines are in the file to begin with. For example, if the file looks like this: line 1 (header)
line 2 (interesting line)
line 3 (interesting line)
line 4 (footer)
I just want to extract the middle "interesting lines" without the header/footer lines.
I can't use grep to remove the header/footer, because I don't know what those lines will contain, only that they exist and are exactly 1 line each. In general, I don't know how many lines are in the file.

Perl One Liner To Delete Line In Csv File If One Columns Is Toobig

I have a little bash script that cats out a file and tells me if there is a line
where the 11th column has more than 6 characters in it.
It emails me where there is a bad line in a file - bead meaning that it will break a
donwstream process.

anyhow when i get the email saying that there is a bad file i just log in to the pc via
vpn and the I sed out the lines from the file that I get in the email. The bad lines are
always in danny.csv not danny1.csv
It has been the same lines killing the downstream process for a few weeks, so i put the "sed -i's" into
the script and it does it automagically.

[CODE]
for i in danny.csv danny1.csv
do
cat /come/and/play/with/$i | perl -ne 'print if length((split /,/)[10]) > 6' | mail -s "danny.csv bad line" casper@casperr.com
done

#it would be nice to find a perl change the file in place
sed -i '/D,642,0642,UBF,EVL,,M,,S,S,FOREVER,213,213,/d' /come/and/play/with/us/danny.csv
sed -i '/D,642,0642,UBF,EVL,,M,,S,S,QSP-U=C,4,4,/d' /come/and/play/with/us/danny.csv
[CODE]

However when a new line gets put into this file, I am going to have to log in and take out the line.
SO I have been trying to write a perl one liner that will edit the file in place, like sed, and make a
backup of the file. I just need a perl one liner that will delete any line where the 11th columns has more
than 6 characters in it.
[CODE]
perl -p -i.bak -e 's/\,\w{7}\,//g - which does not work.
[CODE]
I tried something like this:

[CODE]
perl -nle 'print if /\,\w{7}\,/' /come/and/play/with/us/danny.csv
[CODE]
but that does not catch the QSP-U=C and it catches more lines than just the
FOREVER. for a solutinog I need to focus on the the 11th column.

Strip Last Lines Off Pipe

I have a datastream going through a pipe,and I need to strip-out (remove) the last 3 lines (trailer) from that stream so that it doesn't go down to the next command in the stream.
ive tried combinations of head/tail, but that all assumes you know ahead of time how many lines are in the stream to begin with...