【问题标题】:How to draw a table with using gnuplot如何使用 gnuplot 绘制表格
【发布时间】:2014-03-16 03:14:43
【问题描述】:

我想使用 gnuplot 在绘图上叠加表格。 基本上,我有表值,想创建一个表并将其添加到信号图上。

【问题讨论】:

    标签: gnuplot


    【解决方案1】:

    这可以使用 epslatex 终端和 set label 来完成,使用 Latex 语法定义表。一个最小的例子:

    在 gnuplot 中做:

    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

    \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,现在看起来像这样:

    您可以使用 Latex 语法进一步格式化表格,显然所有不同的 gnuplot 选项都与 epslatex 终端兼容。

    【讨论】:

    • 不需要使用单独的LaTeX文档,使用set terminal epslatex standalone即可。
    • 是的,如果您只有几个包,您可以使用header 选项,如set terminal epslatex standalone header "\\usepackage[T1]{fontenc}\\usepackage{lmodern}"。或者您可以创建一个文件gnuplot.cfg,其中包含所有必需的包,并将其放在 TeX 路径中。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-08-26
    • 2021-02-06
    • 1970-01-01
    相关资源
    最近更新 更多