【问题标题】:Spacing between boxes / tics in gnuplotgnuplot中框/抽动之间的间距
【发布时间】:2018-07-21 05:04:44
【问题描述】:

我正在尝试使用“with box”命令在 gnuplot 中绘制绘图。问题是我可以使盒子更窄,但盒子之间的间距仍然存在。这让剧情看起来很傻。 link to picture

我查看了边距、抽动偏移量,并试图找出框的样式,但无法让它看起来不错。

首先,我想了解导致间距的原因。盒子式还是抽动式?当然,我不会把它命名为ABCD,那样我会有更长的抽动时间。

稍后,我想旋转它并将其包含在 LaTeX 文件中,但问题也存在于 gnuplot 的 wxt 终端/图形输出中。

我用来生成绘图的代码:

datenfile = "daten.txt"
yachsentitel = "Parameter [\\%]"
set ylabel yachsentitel 
unset key
unset grid
unset border
set boxwidth 0.2
set xtics rotate by 90 right 
set ytics rotate by 90 center
set style fill solid
set output "parameter.png"
set term png
plot datenfile using 2:xtic(1) with boxes

我的数据文件是:

"A."            5.1
"B."            1.73
"C."            0.15
"D."            3.2

【问题讨论】:

    标签: gnuplot spacing pdflatex


    【解决方案1】:

    “带框”的绘图样式需要两个信息字段:x(水平放置)和 y(高度)。通常,绘图命令类似于

      plot "data" using 1:2 with boxes
    

    其中 x 在第 1 列,y 在第 2 列。

    如果您在“使用”部分中仅提供一个数据列说明符,则它将被解释为 y 和 x 值是从从 0 开始的连续行号生成的。这相当于 gnuplot 所谓的“第 0 列”和相应的完整的命令是

     plot "data" using 0:1 with boxes
    

    为了什么

     plot "data" using 1 with boxes
    

    是一种简写形式。如果您更喜欢生成其他一些 x 位置集,您可以将其显式放入 using 说明符中:

     plot "data' using (column(0) * 0.1) : 2 : xtic(1) with boxes
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-07-17
      • 1970-01-01
      • 1970-01-01
      • 2021-02-13
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多