0

I would like to superimpose table on a plot with using gnuplot. Basically, I have table values and want to create a table and add it on the signal plot.

1 Answer 1

2

This can be done using the epslatex terminal and using set label, defining the table using latex syntax. A minimal example:

Within gnuplot do:

set term epslatex
set output "plot.eps"
set label at screen 0.5,0.5 '\begin{tabular}{c c}1 & 2 \\ 3 & 4\end{tabular}'
plot sin(x)

Then create a latex file document.tex with the following code:

\documentclass{article}
\usepackage[papersize={100cm,100cm}]{geometry}
\usepackage{graphicx}

\begin{document}

\thispagestyle{empty}

\include{plot}

\end{document}

Then run

latex document.tex
dvipdf document.dvi
pdfcrop document.pdf

The final output is document-crop.pdf, which will now look like this: enter image description here

You can use latex syntax to further format the table, and obviously all the different gnuplot options compatible with the epslatex terminal.

Sign up to request clarification or add additional context in comments.

2 Comments

No need to use a separate LaTeX document, just use set terminal epslatex standalone.
Yes, if you have only a few packages, you can use the header option like set terminal epslatex standalone header "\\usepackage[T1]{fontenc}\\usepackage{lmodern}". Or you can create a file gnuplot.cfg which contains all the required packages, and put it in the TeX-path.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.