Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 03-19-2017, 03:52 PM   #1
Senior Member
Registered: Jun 2006
Location: Debian Land
Posts: 1,780

Rep: Reputation: 155Reputation: 155
Making a simple graph with Gnuplot 4.6?


I am trying to use gnuplot but nothing works:
dpkg -l | grep gnuplot
ii  gnuplot                             4.6.6-2                              all          Command-line driven interactive plotting program
ii  gnuplot-data                        4.6.6-2                              all          Command-line driven interactive plotting program. Data-files
ii  gnuplot-qt                          4.6.6-2                              i386         Command-line driven interactive plotting program. QT-package
ii  gnuplot-tex                         4.6.6-2                              all          Command-line driven interactive plotting program. Tex-files
with any files, it results in error.


gnuplot steps.1.gnu 

set title "Compare steps, fsteps and histeps" 0.000000,0.000000  font ""
"steps.1.gnu", line 3: ';' expected

with gnuplot 5 same story:
gnuplot5 simple.5.gnu

set colorbox vertical origin screen 0.9, 0.2, 0 size screen 0.05, 0.6, 0 front noinvert bdefault
"simple.5.gnu", line 26: invalid colorbox option

Gnuplot looks a bit buggy and non reliable,...

Last edited by Xeratul; 03-19-2017 at 03:58 PM.
Old 03-21-2017, 12:55 PM   #2
Registered: Mar 2011
Location: Sutton, MA. USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu
Posts: 4,672
Blog Entries: 10

Rep: Reputation: 1687Reputation: 1687Reputation: 1687Reputation: 1687Reputation: 1687Reputation: 1687Reputation: 1687Reputation: 1687Reputation: 1687Reputation: 1687Reputation: 1687
I think there are legitimate syntax errors in your terms, which is what gnuplot is telling you.

You can't put x,y in the title, instead I think you need to set key to locate it other than the default. If I remove the x,y from that, mine works.

You are not supposed to have the term screen following origin or size in the colorbox set, the zero before front is also incorrect, as is the noinvert. If I remove the two "screen" terms, the 0 before front, and the "noinvert" it also works correctly.

At least according to the 4.6 documentation:
1 members found this post helpful.
Old 03-21-2017, 01:23 PM   #3
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=14, FreeBSD_10{.0|.1|.2}
Posts: 4,082
Blog Entries: 1

Rep: Reputation: 2149Reputation: 2149Reputation: 2149Reputation: 2149Reputation: 2149Reputation: 2149Reputation: 2149Reputation: 2149Reputation: 2149Reputation: 2149Reputation: 2149
The linked file does contain errors, probably due to naive copy/paste from some earlier example that nobody tested.

Go back one page to the page which links that file and copy/paste the gnuplot code shown there...

set title "Compare steps, fsteps and histeps"
plot [0:12][0:13] "steps.dat" notitle with points,  \
 "steps.dat" title 'steps' with steps, \
 'steps.dat' title 'fsteps' with fsteps, \
 'steps.dat' title 'histeps' with histeps
...paste that into the file steps.1.gnu (in the same directory with the steps.dat file), then...

gnuplot -p ./steps.1.gnu works.

It would probably be a good learning exercise for you to compare the two and find the errors.

Gnuplot is not buggy, well, no more so than any other piece of software. But the syntax can be very rich, and prone to operator error - but well worth learning!

I would suggest setting up a directory where you systematically explore each major syntax feature in your own examples and keep notes! I have such a workspace which I have maintained over the years, with accumulated notes and examples which allow me to work out new plots easily when required.

Update - I looked at a few more examples from the links in your original post and found there are indeed others with errors, others without errors.

The problem appears to be that the linked code has been autogenerated from an earlier HTML version of the website, or other source, without anyone actually checking them. From the top of the V5 examples page...

autogenerated by
In the initial examples I checked, the code shown in page with the plots is correct, and the linked code has errors. But I also found counter examples where the linked code was correct and in-page code was incomplete.

You may want to consider notifying the project website maintainers as well.

Last edited by astrogeek; 03-21-2017 at 03:12 PM. Reason: Added update


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] making a gnuplot 3d graph or gnuplot fence plot Rinndalir Programming 3 10-23-2015 01:10 PM
[SOLVED] gnuplot basic graph problem - noob to gnuplot sudowtf Linux - General 2 04-02-2015 11:00 AM
gnuplot graph using trace file naren123.k Programming 6 11-06-2013 02:42 AM
[SOLVED] How to get the graph in Image format through GNUPLOT mq15 Linux - Software 6 02-04-2010 04:16 AM
how to create this graph in gnuplot Exoskeletor Programming 3 01-03-2010 04:22 PM

All times are GMT -5. The time now is 07:00 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration