gnuplot with PGF/tikz

One downside about writing calculus lecture notes has always been drawing graphs. They just take up too much time. What I used to do was to use whatever software at my disposal (usually powerpoint) and created jpeg to embed into my pdf. But it looked untidy and it is difficult to make slight changes to the jpegs.

Two colleagues have been singing the praise of pstricks, but I did not like having to latex -> dvi -> ps -> pdf. Luckily I discovered the PGF/tikz package which is another drawing package in latex. I found the PGF/Tikz system much more amendable, you could do latex to dvi or directly use pdflatex.

Of course it is still a chore to write latex commands. I get around it using geogebra which is a freeware for essentially geometry but it generates PGF/Tikz as well as pstricks code. Once the code is written, it is easy to make adjustments like adding labels, changing axes etc.

The downside of the PGF/Tikz is that certain graphs do not come out right. For that you would have to use gnuplot. It took me a few frustrating days to get everything to work properly in winedt. There are two key tweaks for using gnuplot with winedt on Windows 7. Many thanks to their respective contributors (and google for finding the postings.)

1) After setting the gnuplot path in windows environment, you also need to set it in winedt

http://comments.gmane.org/gmane.editors.winedt/6138

2) You need to enable write-18 for pdflatex to invoke gnuplot

http://www.politicaldata.org/?p=14

This entry was posted in Calculus/Analysis, General, Technology. Bookmark the permalink.

One Response to gnuplot with PGF/tikz

  1. tpc says:

    Update. Wasted half an afternoon trying to get the whole thing working again after changing notebooks. It turned out that all those previous settings couldn’t call gnuplot again. I had installed the latest version 4.6. Out of desperation I reinstalled the old version 4.4 of gnuplot which worked and lo and behold — my lovely plots came back.

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>