Home Forums HCL Reviews Tutorials Articles Register Search Today's Posts Mark Forums Read
 LinuxQuestions.org which terminal to use with gnuplot to work with pdf latex
 Linux - General This Linux forum is for general Linux questions and discussion. If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

 11-07-2009, 09:24 PM #1 sycamorex LQ Veteran   Registered: Nov 2005 Location: London Distribution: Slackware64-current Posts: 5,773 Blog Entries: 1 Rep: which terminal to use with gnuplot to work with pdf latex I'm trying to embed some gnuplot graphs into pdflatex documents. I've had no luck so far. Which terminal is best for pdflatex? Thank you
 11-08-2009, 05:15 AM #2 b0uncer LQ Guru   Registered: Aug 2003 Distribution: CentOS, OS X Posts: 5,131 Rep: There are more than one way I recall, depending on if you are OK with the plain Gnuplot result, or if you want some "extra" like LaTeX symbols into the graphs. If you run Code: set terminal in Gnuplot, you'll see what it can do (probably you knew this already), if you want to try out some of them. It would be nice to have it output .pdf as these you could embed in a (pdf)LaTeX document, but it won't, without a "get-around". Personally I need to have some symbols in the plots that Gnuplot doesn't know how to do. For this I use a little "trick" I read from someone's website long time ago: I set the output terminal to be "epslatex" and write the symbols in the Gnuplot file as in LaTeX (for example \Delta into a title). This produces two files: a .tex file and a .eps file, the other containing the symbols and the other the plot, without symbols. Then I use a minimal (pdf)LaTeX document to combine these two by inputting the .tex file, which results in a .pdf file containing both the plot and the symbols. I'm not doing anything fancy here, so the resulting file is sized A4, whereas the plot itself is typically smaller, so then I still need to use pdfcrop to "cut" the plot out to form a .pdf that contains only the plot (with symbols) and is properly sized, which I can them put in a (pdf)LaTeX document like any other .pdf image. This sounds like awfully lot of work, but it didn't take long for me to write a script that automates most of the work. Now I only need to make the Gnuplot work in a .gp file as I usually do and setting the output terminal to 'epslatex'. Then I run the script and give it the .gp file as an argument (and the output .tex/.eps filename as well, though I usually do this so that it's the same as the .gp filename without suffix -- less writing, less work), and the script runs it through Gnuplot, makes a temporary (pdf)LaTeX file to combine the resulting files, crops the produced .pdf and removes temporary files before exiting, so that the overall result is just the .pdf file (.gp preserved), nothing else. Pretty neat (though the script is a little ugly as of now..but it works). Last edited by b0uncer; 11-08-2009 at 05:20 AM.
 11-08-2009, 08:39 AM #3 sycamorex LQ Veteran   Registered: Nov 2005 Location: London Distribution: Slackware64-current Posts: 5,773 Blog Entries: 1 Original Poster Rep: Thanks, I managed to get it work with 'epslatex'. Could you possibly post your script, please? I'm sure I'll benefit from it. btw, this is how I embed it in a .tex file: Code: \documentclass[11pt,twoside,a4paper]{article} \usepackage{graphicx} \begin{document} \begin{figure} \begin{center} \scalebox{1.0}{\input{plot.tex}} \caption{My caption} \end{center} \end{figure} \end{document}
 02-15-2011, 07:25 AM #4 mtrummer LQ Newbie   Registered: Feb 2011 Posts: 1 Rep: gnuplot and latex Hello, I embedd many gnuplot figures in my latex files. The way I do this is by first using the postscript terminal, and then by converting the eps files to pdf, in order to be able to use them with pdflatex. This works just fine. The problem I have now is that I use the gnuplot symbols 24, 25 and 27 of the postscript pointtypes (half-filled circle, ...). Since I do not like having these symbols with an explanation in the key of the figure, I use latex captions to describe them instead. How do I produce these symbols with pdflatex? Thanks for your help.

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts BB code is On Smilies are On [IMG] code is On HTML code is Off Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post sreejithpk Linux - Software 6 03-18-2009 12:24 PM polzbert Linux - Software 1 01-10-2006 05:54 AM trylinux Linux - Software 3 02-17-2005 05:02 AM realos Linux - General 2 05-31-2004 05:50 AM kwigibo Linux - General 2 01-04-2003 08:44 PM

All times are GMT -5. The time now is 10:49 AM.

 Contact Us - Advertising Info - Rules - LQ Merchandise - Donations - Contributing Member - LQ Sitemap -