Setting the correct terminal
The error you find means that gnuplot is not recognizing a valid terminal. You have to set a valid one. To know the list of the available ones you can ask from the command line of gnuplot
gnuplot> set terminal
And it will answer with something like
Available terminal types:
cairolatex LaTeX picture environment using graphicx package
and Cairo backend
canvas HTML Canvas object
cgm Computer Graphics Metafile
context ConTeXt with MetaFun (for PDF documents)
corel EPS format for CorelDRAW
dumb ascii art for anything that prints text
... Many linees ...
gif GIF images using libgd and TrueType fonts
gpic GPIC -- Produce graphs in groff using the
... Other linees ...
For each of them you can ask to gnuplot itself for more information, for example with help terminal gif
.
Then you can simply set the terminal, if you have try the dumb one it's lovely.
gnuplot> set terminal dumb
gnuplot> plot 0.5*sin(x/2) lt 0, cos(x/2)
1 ++---------------+---------------####---------------+---------------++
+ + ## + ## 0.5*sin(x/2) +....+ +
0.8 ++ # # cos(x/2) ######++
| # # |
0.6 ++ # # ++
|++++++ # #+++++++ |
0.4 ++ +++ # ++ # +++ ++
# +++ # ++ # ++ #
0.2 +# ++ ## ++ ## + #+
0 +# ++ # ++ # ++ #+
| # ++ # ++ # ++ # |
-0.2 ++ # + # ++ # ++ # ++
| ## ++ # ++ # +++ ## |
-0.4 ++ # +++# ++ # +++# ++
| # #+++++++ # #+++++|
-0.6 ++ # # # # ++
| ## ## ## ## |
-0.8 ++ # # # # ++
+ ## ### + ### ## +
-1 ++---------#####-+-----------------+----------------+-#####---------++
-10 -5 0 5 10
If you have not the possibility to use a terminal from which "you can see" (wxt
,qt
,x11
,aqua
...), use a graphic format and save the output on an external file. In this way you will create a file in the directory from which you run gnuplot.
set terminal png enhanced truecolor # ... whatever ...
set output 'tempfile.png' # you need to redirect to a file the output
plot 0.5*sin(x/2) lt 0, cos(x/2) # your plot commands
# replot # it should be cosy if you are not doing multiplot
set out # restore the output redirection
set terminal GNUTERM # restore the default terminal
Note:
You may need to install the different packages -qt,-nox,-x11
to have different features (the OP just did it) or to compile by yourself to add other ones.
Best Answer
This is the default behaviour for single column files. The difference is that the standard numbering is to number x=0,1,2,...
Here's my data (in file temp.dat)
Plot with
or similar.
To shift the x-axis so that x=1,2,3...