问题
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:
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:
You can use latex syntax to further format the table, and obviously all the different gnuplot options compatible with the epslatex terminal.
来源:https://stackoverflow.com/questions/22427878/how-to-draw-a-table-with-using-gnuplot