gnuplot linux to windows - linux

I am running the below Gnuplot code in Linux.
I want to know how I can run the same code on windows?
Thanks a lot!
reset
set termoption dash
set terminal postscript portrait enhanced color "Helvetica" 10
set output '| ps2pdf - Plot.pdf'
set datafile separator ","
mag = 5
set grid
set border 31 lw 1
set key off
set style line 1 lt 1 lw 10 pt 6 ps 0.4 lc rgb '#D3D3D3'
TET_0011 = "/home/soheil/university/quadratic/KAPPA & MU/TET-VOIGT-SR-0.01.txt"
plot TET_0011 u 1:4 w l ls 1 title "VOIGT"

Gnuplot is supported on windows using Cygwin or MinGW.
Checkout the binary download page for gnuplot windows binaries.
The gnuplot code you post above will remain the same.

The only problem i see on windows is the lack os ps2pdf
Fortunately, you could set to generate PDF directly, instead of set terminal postscript ... you should have pdfcairo terminal
set terminal pdfcairo OPTIONS
It is available on gnuplot on windows, v5.0.x

Related

Gnuplot: Tilde Symbol in pngcairo image

I use Gnuplot with pngcairo terminal and my question ison can I put the tilde symbol on a letter?
I know that in latex the command is \tilde{f}.
I've tried with f{\Symbol 304} or f\\~.
How can I do?
Check help enhanced text.
With this:
### tilde over character
set label 1 "~f{0.9\\~}" at screen 0.25, 0.75 font ",20"
plot x
You get the following (wxt terminal):

Gnuplot scripting set terminal gives me ascii characters

I am trying to run gnuplot script in xubuntu that had worked last months but from today it gives me ascii characters and not the desired png file with plot. I track the problem and seems that is at set terminal command.
Any idea?
#!/usr/bin/gnuplot
reset
set terminal png size 1024,768
set xlabel "Time"
set ylabel "Position"
set title "Title1"
set key reverse Left outside
set grid
set style data lines
plot "file.txt" using 1:2 title "North", \
"" using 1:3 title "East", \
"" using 1:4 title "Up" #
Finally found a solution,
worked only gif file so i sudo apt-get purge gnuplot* and reinstall sudo apt-get install libgd2-noxpm-dev then reinstall sudo apt-get install gnuplot-x11 and everything works!!!!!

Gnuplot creates empty eps file

I am trying to create an EPS file using gnuplot using the following code:
set terminal postscript eps enhanced
set output 'file.eps'
plot 'mydata.dat' using 1:2
replot
quit
But to no avail, EPS file does not have any plot in there. I dont know what I am missing, i got ghostscript, ghostscript-fonts and psutils. EPS files is just empty white file. I have searched the web but nothing just works.
How to I generate the EPS file with plot in it?
Specs:
Fedora 21 x64_86
gnuplot-4.6 patch 5
ghostscript 9.15
"conf" :
set terminal postscript eps enhanced
set output 'file.eps'
plot 'mydata.dat' using 1:2 with linespoints
replot
quit
And you will need some data for the file mydata.dat, example from http://lowrank.net/gnuplot/datafile2-e.html , ref. https://www.google.com/webhp?hl=all&gws_rd=ssl#hl=en&q=gnuplot+plot+file
# X Y1 Y2
1.0 0.0 0.1
2.0 0.0 0.1
3.0 0.0 0.1
4.0 0.1 0.2
5.0 0.6 0.4
6.0 1.0 0.9
7.0 1.2 1.7
8.0 1.3 2.4
$ gnuplot conf : OK, a nice plot, file.eps .
Ok, I have now solved it, It appears that there is a conflict between ghostscript and infinality so I uninstalled it
sudo yum remove *infinality*
and Viola! Things works now! :)

plot is not generated (gnuplot from command line)

In sample.dat I have:
set terminal pngcairo transparent enhanced font "arial,10" fontscale 1.0 size 500, 350
set output 'simple.2.png'
plot [-pi/2:pi] cos(x),-(sin(x) > sin(x+1) ? sin(x) : sin(x+1))
From ubuntu/terminal I execute:
gnuplot -e "filename='sample.dat'"
but the simple.2.png file is not created. How do I export a plot to e.g png using gnuplot from command line?
I have no idea where you got that from!
To execute a gnuplot script (here called simple.gp), simply call
gnuplot simple.gp
You should keep the extension .dat for data files.

Font in Gnuplot Postscript Terminal

I would like gnuplot to use the same font in the postscript-terminal as it does in the wxt-terminal. The Gnuplot help says that wxt uses "Sans" by default. Now, if i set the terminal to
gnuplot> set term post enhanced color "Sans" 12
Terminal type set to 'postscript'
Options are 'landscape enhanced defaultplex \
leveldefault color colortext \
dashed dashlength 1.0 linewidth 1.0 butt noclip \
palfuncparam 2000,0.003 \
"Sans" 12 '
then the font looks very different to the one in wxt.
I am using Ubuntu 10.04 lucid.
Which font would you suggest me to use? Any ideas welcome.
I've also tried "cm-super" to get latex-fonts (computer modern) in gnuplot. Actually it worked, but the text overlapped boxes and margins very often!
Greets,
mefiX
Since the considered plots are part of a LaTeX document, I decided to use the computer modern fonts described earlier.
gnuplot> set term post enhanced color fontfile "/usr/share/texmf/fonts/type1/public/cm-super/sfss1200.pfb" "SFSS1200"
Terminal type set to 'postscript'
Font file '/usr/share/texmf/fonts/type1/public/cm-super/sfss1200.pfb' contains the font 'SFSS1200'. Location:
/usr/share/texmf/fonts/type1/public/cm-super/sfss1200.pfb
Options are 'landscape enhanced defaultplex \
leveldefault color colortext \
dashed dashlength 1.0 linewidth 1.0 butt noclip \
palfuncparam 2000,0.003 \
"SFSS1200" 14 fontfile "/usr/share/texmf/fonts/type1/public/cm-super/sfss1200.pfb" '
As already mentioned, you can install these under ubuntu by calling
# apt-get install cm-super
on the root command line.
Note that the characters in SFSS1200 describe font encoding (Latin1, ...), style (Sans-Serif, ...) and desired resolution in dpi.

Resources