Graphics, Figures & Tables ⇒ How can I draw plots in LaTeX?
Re: latex,gnuplot
Nothing of that didnt help.
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
Re: latex,gnuplot
Probably not calling external program is good advantage, but there are also other parameters.
And I think I could use gnuplot, but I just cant find what is wrong. As I mentioned before, I get the identically same result, using either PCTeX or MIKTeX, so it must be something with gnuplot, ot its connection with latex.
I alredy post log file from both editors, but they didnt show exactly where the problem is.
I also look at all requirements, that I found on the web page with example and I think I have manage to satisfy them all.
So, I please if somebody(using windows, and latest wersionon of gnuplot ) can tell me how its output look like.(like did Stefan in the second post) so I can see is there something wrong with using this code in widows or is the problem in my computer.
And I also please if somebody has any idea what else can I check or where to look to find solution.
Re: latex,gnuplot
I have read post under the graph(on the original page with istructons for picture) that something in the file pgfmodule.code need to be changed. I have attach the file, here, if anaybody have any suggestion what can I change here.
- Attachments
-
- dsd.pdf
- (121.28 KiB) Downloaded 604 times
Re: latex,gnuplot
How can I draw plots in LaTeX?
How can I draw plots in LaTeX?
Code: Select all
\documentclass{article}
\usepackage{pgfplots}
\begin{document}
\begin{tikzpicture}
\begin{axis}[%
xlabel={x},
ylabel={$\left(\frac{\sin(x)}{x}\right)^2$},
xmin=-10,xmax=10,ymin=0,ymax=1,
xtick={-10,-5,...,10},
ytick={0,0.2,...,1}
]
\addplot[domain=-10:10,samples=100] gnuplot {(sin(x)/x)**2};
\end{axis}
\end{tikzpicture}
\end{document}
table' could not be found. Maybe you need to enable the shell-escape feature? F
or pdflatex, this is '>> pdflatex -shell-escape'. You can also invoke '>> gnupl
ot <file>.gnuplot' manually on the respective gnuplot file..
See the pgfplots package documentation for explanation.
Type H <return> for immediate help.
error.
Why is better using gnuplot as two separate progrmas?
How can I draw plots in LaTeX?
It runs flawless for me. Did you run it with »shell-escape« enabled?ditka wrote:Code: Select all
! Package pgfplots Error: Sorry, the gnuplot-result file 'ffgsffsfsfs.pgf-plot. table' could not be found. Maybe you need to enable the shell-escape feature? F or pdflatex, this is '>> pdflatex -shell-escape'. You can also invoke '>> gnupl ot <file>.gnuplot' manually on the respective gnuplot file.. See the pgfplots package documentation for explanation. Type H <return> for immediate help. error.
Re: latex,gnuplot
How can I draw plots in LaTeX?
For precisely the reason you're having trouble trying to use them together.ditka wrote:Why is better using gnuplot as two separate progrmas?

It's just much easier to use gnuplot and LaTeX separately. Another advantage is that for large documents you don't have to wait a long time for the LaTeX compilation to end to see what the plot will look like; you could just run gnuplot separately and immediately see how the plot looks.
How can I draw plots in LaTeX?
Well, that depends... for the example above I had to hit one (!) button only. Can't get much easier than that…shadgrind wrote:It's just much easier to use gnuplot and LaTeX separately.

That's why I always have a second file (usuallyshadgrind wrote:Another advantage is that for large documents you don't have to wait a long time for the LaTeX compilation to end to see what the plot will look like; you could just run gnuplot separately and immediately see how the plot looks.
test.tex
) opened in my editor. No need to compile the whole document. 