Graphics, Figures & TablesConfiguration gnuplot and teXnicCenter

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
gdminfo
Posts: 7
Joined: Wed May 27, 2009 5:23 pm

Configuration gnuplot and teXnicCenter

Post by gdminfo »

Hi

I would like to use gnuplot and Latex as the results of the first one are directly computed by Latex and will be print on the final Latex pdf document.

For example, it is possible to write :

Code: Select all

plot "myFile1" u 3:1, "myFile1" u 5:6 
in order to make 2 lines computed from the file 'myFile1' and which are described on x1 column 3 y1 column 1, x2 column 5, y2 column 6.

A this time in teXnicCenter I have in ouput
"path to the (La)Tex compiler" : C:\Program Files\MiKTeX 2.7\miktex\bin\pdflatex.exe
and
"command line arguments to pass to the compiler : " -interaction=nonstopmode "%pm"
I know that I have to create a new ouput profile and change some parameters, but what ?

Thanks you for your help.

GDM

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Configuration gnuplot and teXnicCenter

Post by localghost »

Take a look at the gnuplottex package or think about doing your plots with pgfplots (based on pgf/tikZ) or PSTricks. Another alternative could be Asymptote. There is also an asymptote package for use with LaTeX.


Best regards
Thorsten
gdminfo
Posts: 7
Joined: Wed May 27, 2009 5:23 pm

Configuration gnuplot and teXnicCenter

Post by gdminfo »

Thanks for your advices, I choose to use pgfplots, so I did not have to configure teXnicCenter.

For information :

Code: Select all

\usepackage{tikz}
\usepackage{pgf}
\usepackage{pgfplots}
\usepackage{etex} % really useful ?

% With a file fichierD.dat describes below

\begin{tikzpicture}
\begin{loglogaxis}[
xlabel=Cost ,
ylabel=Error]
\addplot[color=blue,mark=*] table[x=Cost,y=Error] {fichierD.dat};
\addplot[color=red,mark=*] table[x=Level,y=Error] {fichierD.dat};
\end{loglogaxis}
\end{tikzpicture}
File fichierD.dat :
Level Cost Error
1 7 8.471e-02
2 31 3.044e-02
3 111 1.022e-02
4 351 3.303e-03
5 1023 1.038e-03
6 2815 3.196e-04
7 7423 9.657e-05
8 18943 2.873e-05
9 47103 8.437e-06
This makes 2 lines.

GDM.
pseudostrg
Posts: 1
Joined: Fri Jul 17, 2009 12:14 pm

Re: Configuration gnuplot and teXnicCenter

Post by pseudostrg »

Just in case someone runs into the same problem: (as I feel its an odd solution)
Using gnuplot with TeXniccenter on Windows (XP, Vista?) won't work because gnuplot can't be found (e.g. for making plots with TikZ)

a) add the path to the /bin directory where u installed gnuplot to the windows "path" variable (under control panel -> system -> advanced -> environment variables)

b) make sure there is a COPY of the executable in the /bin folder called "gnuplot.exe" (what i had to do is copy "pgnuplot.exe" to "gnuplot.exe"... wtf!?)

c) add "-enable-write18" to the command line options of the output profile ur using in texniccenter

d) have a nice DaY

H
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Configuration gnuplot and teXnicCenter

Post by localghost »

pseudostrg wrote:b) make sure there is a COPY of the executable in the /bin folder called "gnuplot.exe" (what i had to do is copy "pgnuplot.exe" to "gnuplot.exe"... wtf!?)
Renaming 'pgnuplot.exe' to 'gnuplot.exe' will suffice.
pseudostrg wrote:c) add "-enable-write18" to the command line options of the output profile ur using in texniccenter
This only works for MiKTeX. The Tex Live compilers need the switch -shell-escape to get things work.


Best regards and welcome to the board
Thorsten
rgreenhaw
Posts: 1
Joined: Fri Oct 16, 2009 8:36 pm

Re: Configuration gnuplot and teXnicCenter

Post by rgreenhaw »

Also, gnuplot called from LaTeX in teXnicCenter does not work well with file names that contain spaces (e.g., My Thesis.tex).
gdminfo
Posts: 7
Joined: Wed May 27, 2009 5:23 pm

Re: Configuration gnuplot and teXnicCenter

Post by gdminfo »

Many thanks for all these additional comments ! ;)

GDM.
Post Reply