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 »

It seems that PCTeX provides it's own editor, without a specific name, seen at the PCTeX6 Tour. As this seems to be proprietary, I suggest the same as Thorsten: ask the PCTeX support. PCTeX is not freely available, so we hardly can help you.

As PCTeX 6 has been released 2007, with some updates until 2011, this would not be my first choice, when I compare with newer releases such as TeX Live 2012 and MiKTeX 2.9.

I doubt that the official PCTeX6 forum would help much: the majority of questions hasn't got any answer.

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 »

What abaut MikTex? How can that be done here?

I have instaled gnuplot.
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 »

If you installed MiKTeX, you probably also installed TeXworks. Look for it in the start menu.

With TeXworks, go to the main menu: Edit / Preferences, choose the Typesetting tab, choose pdfLaTeX, click the Edit button, add --enable-write18 such as here:
texworks.png
texworks.png (79.85 KiB) Viewed 6496 times
Stefan
LaTeX.org admin
ditka
Posts: 85
Joined: Fri Jul 13, 2012 11:59 am

Re: latex,gnuplot

Post by ditka »

I did what you say, but I still get the same picture.

Do I need to do anything else, perhaps in gnuplot?

I just download document and typsett it.
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

How can I draw plots in LaTeX?

Post by localghost »

Since the settings for TeXworks differ a bit on Wind0ws, here is s screen capture for MiKTeX (see attachment).
[…] Do I need to do anything else, perhaps in gnuplot? […]
How did you install Gnuplot? The latest version 4.6 has an installer for the first time. You need to check a box in order to add the Gnuplot path to the corresponding environment variable (see attachment).
Attachments
The compiler settings in TeXworks for MiKTeX
The compiler settings in TeXworks for MiKTeX
TeXworks044-MiKTeX-Preferences-ToolConfiguration.png (42.17 KiB) Viewed 6493 times
The Gnuplot 4.6 Installer with the checked box for the PATH environment variable.
The Gnuplot 4.6 Installer with the checked box for the PATH environment variable.
Gnuplot-46-Setup.png (23.37 KiB) Viewed 6493 times
ditka
Posts: 85
Joined: Fri Jul 13, 2012 11:59 am

Re: latex,gnuplot

Post by ditka »

I did that(enable--write18,check Add application directory to your PATH environment variable), but I still get the same picture.

Do I need draw graphs in gnuplot first?
User avatar
Stefan Kottwitz
Site Admin
Posts: 10322
Joined: Mon Mar 10, 2008 9:44 pm

Re: latex,gnuplot

Post by Stefan Kottwitz »

Gnuplot is called automatically. Perhaps post your .log file here, as attachment to a post. The log file contains information regarding the problem.

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

Re: latex,gnuplot

Post by ditka »

I hope this is the right thing.
Attachments
ldsld lfslfld.txt
(15.48 KiB) Downloaded 377 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 »

Yes, this is the right file. I can see these warnings:

Code: Select all

Package pgf Warning: Plot data file `ndkskdkskdksdda-1.x.table' not found. on i
nput line 43.

Package pgf Warning: Plot data file `ndkskdkskdksdda-1.sin.table' not found. on
 input line 45.

Package pgf Warning: Plot data file `ndkskdkskdksdda-1.exp.table' not found. on
 input line 47.
Obiously gnuplot did not run, to produce the .table files.

I have another suggestion: instead of dealing with gnuplot problems, you could switch to pure TeX/LaTeX plotting. Since you now use a modern MiKTeX version, you could work with pgfplots. This is a very capable package for plotting with markers, axis, legends, in 2D and 3D. Perhaps have a look at the pgfplots documentation for a start with it, try some examples from the manual. If you have a question regarding pgfplots, just open a new topic.

Stefan
LaTeX.org admin
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

How can I draw plots in LaTeX?

Post by localghost »

Stefan_K wrote:[…] I have another suggestion: instead of dealing with gnuplot problems, you could switch to pure TeX/LaTeX plotting. Since you now use a modern MiKTeX version, you could work with pgfplots. This is a very capable package for plotting with markers, axis, legends, in 2D and 3D. Perhaps have a look at the pgfplots documentation for a start with it, try some examples from the manual. […]
As far as I know, pgfplots uses Gnuplot as back-end. So the problem would persist.
Post Reply