Right now, I create plots in the spreadsheet, copy them to OpenOffice Draw, save as images, and then put them (as images) into my .tex file.

But that leads to problems with resolution (labels too big/small), difficulties to change the graph when data changes, etc.

Is there some better way to do it?

2 Answers 2


If you need to plot a series of points in the spreadsheet you could use the pgfplots packet. First of all export your data as a csv file (Comma Separated Values). Then you can easily plot the points, I made a small example for you:


%% NB: Declare logarithmic axis 
    % Labels for the axis
    ylabel=$L_2$ error]
%% in the options you select the columns to be used as data sources
\addplot table[x=dof,y=error2,col sep=comma] {../pgftables/data.csv};

This produces as output: enter image description here

and this is the original data:

# Convergence results
# fictional source, generated 2008
  • That example is pretty, but can pdfplots plot all those graphs that OpenOffice can?
    – Rogach
    May 2, 2012 at 10:23
  • 2
    You can take a look at the manual, I would say you can plot basically anything. iro.umontreal.ca/~simardr/pgfplots.pdf
    – gcedo
    May 2, 2012 at 10:28

You mean you save it as a raster graphic (PNG or, iih, JPG)? You shouldn't do that. Make a PDF out of it, which should be possible with Open Office out-of-the-box. You need the diagram on a page of it's own, or better in a document of its own. Then use pdfcrop on the PDF to crop the white space around the image and include it as PDF image using \includegraphics. This will work fine with pdflatex, xelatex and lualatex. For DVI mode (latex) you can convert the PDF to EPS using several tools.

Using this way the graphic will be a vector graphic and you don't have any issues with resolution.

  • 2
    OpenOffice can do this by default, but (at least on 3.4) it requires manually setting the page size to that of the graph; its very difficult to get the measurement perfect. I abandoned my effort with OO.org and PDF export and just used R instead.
    – new123456
    May 2, 2012 at 11:15
  • 3
    @new123456: Using pdfcrop afterwards should remove all white space. May 2, 2012 at 12:34

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .