Graphics, Figures & Tables ⇒ How can I draw plots in LaTeX?
Re: latex,gnuplot
NEW: TikZ book now 40% off at Amazon.com for a short time.
And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p
Re: latex,gnuplot
Does anybody have idea why this is happening?
Re: latex,gnuplot
- Stefan Kottwitz
- Site Admin
- Posts: 10335
- Joined: Mon Mar 10, 2008 9:44 pm
How can I draw plots in LaTeX?
You tried the alternative way withditka wrote:Since there is apparently no one with similar problems, does somebody have any ideals what else can I change or look, or where to ask to fix this?

Stefan
Re: latex,gnuplot
-
- Site Moderator
- Posts: 814
- Joined: Tue Jul 01, 2008 2:19 pm
How can I draw plots in LaTeX?
Re: latex,gnuplot
Re: latex,gnuplot
- Stefan Kottwitz
- Site Admin
- Posts: 10335
- Joined: Mon Mar 10, 2008 9:44 pm
How can I draw plots in LaTeX?
I agree with Joseph: pgfplots doesn't need gnuplot. That makes it easier to use. Simple example, which I posted recently on matheplanet.com:ditka wrote:Yes, pgf also needs gnuplot
Code: Select all
\documentclass{article}\usepackage{pgfplots}\begin{document}\begin{tikzpicture}\begin{axis}[axis x line=middle, axis y line=middle]\addplot[domain=0:5, samples=100, smooth] {1/sqrt(x)};\end{axis}\end{tikzpicture}\end{document}
In the calculation during compilation, this may be true, though one may think about how efficient it is to call an external program many times, at each place where a plot is, producing another auxiliary file each. But for the final pdf it doesn't matter, once it's compiled.ditka wrote:I think it is more efficient drawing graphs with gnuplot that pgf.
This depends on what you define is better. I think it's better, to have a native LaTeX package which perfectly integrates with your document, regarding preamble settings and styles, such as consistency regarding font style and size and math mode in axis labels and the main text.ditka wrote:Yes I know some functions can be done without it, but when you want to draw graphs it is probably better if you use gnuplot.
If compilation speed is so important that it's more worth than style consistency, or if gnuplot offers a feature which pgfplots doesn't, well, use it. But then it's a challenge for less experienced users to get it running.
Perhaps tell us reasons why gnuplot may be better, I'm interested to know. You already mentioned efficiency (though I guess you mean speed, but not disk space, plot data files cost space with gnuplot).
Stefan
- Stefan Kottwitz
- Site Admin
- Posts: 10335
- Joined: Mon Mar 10, 2008 9:44 pm
How can I draw plots in LaTeX?
This can be an operating system issue. LaTeX just calls "gnuplot", so it has to be installed so that it can be called. For example, the executable file of gnuplot has to be in the PATH environment variable of Windows, where programs are searched. Test at the command prompt: call gnuplot at the command prompt (cmd). If it doesn't start there, then also LaTeX doesn't have a chance to find it.ditka wrote:I think latex is just not able to conect with gnuplot, and I dont have idea why.
Stefan