Graphics, Figures & TablesHow can I draw plots in LaTeX?

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
User avatar
Stefan Kottwitz
Site Admin
Posts: 10322
Joined: Mon Mar 10, 2008 9:44 pm

How can I draw plots in LaTeX?

Post by Stefan Kottwitz »

localghost wrote:As far as I know, pgfplots uses Gnuplot as back-end.
pgfplots evaluates expressions using the pgf math parser, so it's able to work without an external program such as gnuplot. It can work with gnuplot, if specified, such as by

Code: Select all

\addplot gnuplot[..]{...}
but it works fine also without it.

Stefan
LaTeX.org admin

Recommended reading 2024:

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

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

ditka
Posts: 85
Joined: Fri Jul 13, 2012 11:59 am

Re: latex,gnuplot

Post by ditka »

When I use pgf plots and \addplot gnuplot[..]{...}

I could not typesett file.

On the web page, where I download the original picture it says that windows users my have to rename wgnuplot to gnuplot. It possible that this is the reason why graphs are not plotted?(I have already named gnuplot in the icon, where I click to open program)

And is it possible, that I can confirm or check that I all use of external programs with--enable-write18 successfully?(Although I follow instructions completely)
User avatar
Stefan Kottwitz
Site Admin
Posts: 10322
Joined: Mon Mar 10, 2008 9:44 pm

How can I draw plots in LaTeX?

Post by Stefan Kottwitz »

ditka wrote:When I use pgf plots and \addplot gnuplot[..]{...}
What did you try? Which code did you use for testing? I recommend take code from the pgfplots manual.

I guess you did not understand: use \addplot without gnuplot to avoid using gnuplot. pgfplots can work without it.
ditka wrote:I could not typesett file.
Please provide further information, such as: what source code did you try, what happened, which error message did you get, perhaps the .log file.
ditka wrote:And is it possible, that I can confirm or check that I all use of external programs with--enable-write18 successfully?(Although I follow instructions completely)
We don't know what you did. You did not tell which editor you used. In case, that you switched to TeXworks, as recommended, you did not confirm it. If you would like to discuss your settings, post details or (better) screenshots.

I guess you like it to read understandable answers, code, clear explanation, screenshots - so please post also questions with code, error messages, screenshots of problematic editor settings, post all information possible.

If the question remains vague and without details, other users hardly can help you.

Stefan
LaTeX.org admin
ditka
Posts: 85
Joined: Fri Jul 13, 2012 11:59 am

Re: latex,gnuplot

Post by ditka »

With pgf I was able to plot pictures("normally". The problems was just with \addplot gnuplot[..]{...} option.

As with original question:

If I typeset file(that one http://www.texample.net/tikz/examples/gnuplot-basics/) I get the same picture(that I post at the beginning), wheather I use PCTeX or MIKTeX. I alredy post log file for MIKTeX, here is one for PCTeX.

And yes, with MiKTeX I use TexWorks.
Attachments
pctexd.txt
(13.67 KiB) Downloaded 466 times
User avatar
Stefan Kottwitz
Site Admin
Posts: 10322
Joined: Mon Mar 10, 2008 9:44 pm

How can I draw plots in LaTeX?

Post by Stefan Kottwitz »

ditka wrote:With pgf I was able to plot pictures("normally". The problems was just with \addplot gnuplot[..]{...} option.
I see, so the general problem regarding producing plots is perhaps solved.
ditka wrote:If I typeset file(that one http://www.texample.net/tikz/examples/gnuplot-basics/) I get the same picture(that I post at the beginning), wheather I use PCTeX or MIKTeX.

And yes, with MiKTeX I use TexWorks.
Can you please post a screenshot of your TeXworks "Tool Configuration" settings, for pdfLaTeX, corresponding to the one described by me and posted by Thorsten earlier?

Stefan
LaTeX.org admin
ditka
Posts: 85
Joined: Fri Jul 13, 2012 11:59 am

Re: latex,gnuplot

Post by ditka »

It is not in English, I hope this wont be a problem.
Attachments
toll conf sdfs.JPG
toll conf sdfs.JPG (73.84 KiB) Viewed 5800 times
User avatar
Stefan Kottwitz
Site Admin
Posts: 10322
Joined: Mon Mar 10, 2008 9:44 pm

How can I draw plots in LaTeX?

Post by Stefan Kottwitz »

I see - move the --enable-write18 entry up to the top, so it cannot be confused with the file name, use the upwards arrow button at the right.

Stefan
LaTeX.org admin
ditka
Posts: 85
Joined: Fri Jul 13, 2012 11:59 am

Re: latex,gnuplot

Post by ditka »

I did. Nothing has changed.
Attachments
toll scrds.JPG
toll scrds.JPG (22.93 KiB) Viewed 5798 times
User avatar
Stefan Kottwitz
Site Admin
Posts: 10322
Joined: Mon Mar 10, 2008 9:44 pm

Re: latex,gnuplot

Post by Stefan Kottwitz »

Well, let's wait a bit, somebody with MiKTeX has to check it. I'm working with TeX Live.

Stefan
LaTeX.org admin
ditka
Posts: 85
Joined: Fri Jul 13, 2012 11:59 am

Re: latex,gnuplot

Post by ditka »

Possibly, although it is possible that something else is wrong, since I get exactly the same output using PCTeX or MIKTeX.

What about gnuplot and wgnuplot?(question I asked before). Is there any relevant file, that I can rename?
Post Reply