如何使用gnuplot绘制表格 [英] How to draw a table with using gnuplot
问题描述
我想使用gnuplot将表格叠加在绘图上. 基本上,我具有表值,并且想要创建一个表并将其添加到信号图上.
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.
推荐答案
可以使用epslatex终端并使用set label
完成此操作,并使用乳胶语法定义表.一个最小的例子:
This can be done using the epslatex terminal and using set label
, defining the table using latex syntax. A minimal example:
在gnuplot内执行:
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)
然后使用以下代码创建乳胶文件document.tex
:
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}
然后运行
latex document.tex
dvipdf document.dvi
pdfcrop document.pdf
最终输出是document-crop.pdf
,现在看起来像这样:
The final output is document-crop.pdf
, which will now look like this:
您可以使用乳胶语法来进一步格式化表格,并且显然可以使用与epslatex终端兼容的所有不同gnuplot选项.
You can use latex syntax to further format the table, and obviously all the different gnuplot options compatible with the epslatex terminal.
这篇关于如何使用gnuplot绘制表格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!