I usually render the graphs elsewhere and import them as png's or svg's depending on the graph. Can highly recommend using ggplot2 in R for making gorgeous graphics.

I usually render the graphs elsewhere and import them as png's or svg's depending on the graph. Can highly recommend using ggplot2 in R for making gorgeous graphics.

That's what I have always done in the past. I just thought I would have a go at doing it in Latex. I have found various existing pieces of code but they are all lacking in some regards.

You can use sweave to integrate the R, if you'd rather do it all in one file.

I don't know anyone who generates any graphics in LaTeX that arent boxes around sections in a poster.

As little as I know about Latex, I know ABSOLUTELY nothing about R!! I guess I'll muddle along with importing the graphs from elsewhere until I find a better fix!

LaTeX has vector graphics packages that are quite nice. Unfortunately it takes quite a bit of time to learn them and you have to constantly practice it. Otherwise you forget just how to use them. *cough* *cough*

I agree with Tree. Just use something like gnuplot or R to create the graphs and let LaTeX encapsulate the image of the graph.

If you don't want to go down this route. Then a vector graphics package like Tikz which, among many other things, allows you input mathematical functions and plot them, is what you're looking for.

I like TikZ. Here is a decent introduction: cremeronline.com/LaTeX/minimaltikz.pdf

Or this could be what you are looking for, it has lots of samples of graphs, varying in complexity: pgfplots.sourceforge.net/gallery.html

For example, this will draw a quadratic function:

\begin{tikzpicture}
\begin{axis}[
xlabel=$x$,
ylabel={$f(x) = x^2 - x +4$}
]
% use TeX as calculator:
\addplot {x^2 - x +4};
\end{axis}
\end{tikzpicture}

Hi there!

Thanks for the reply. That link with all those samples is great.

One last thing. Do you know how to input vertical lines into the tex calulator? All the examples seem to need the statement in the form y= stuff. I need the line x=4. It doesn't seem to like that.

Thanks for the reply. That link with all those samples is great.

One last thing. Do you know how to input vertical lines into the tex calulator? All the examples seem to need the statement in the form y= stuff. I need the line x=4. It doesn't seem to like that.

Try this, directly after/instead of the other addplot: