【问题标题】:Gnuplot: Vertical lines at specific positionsGnuplot:特定位置的垂直线
【发布时间】:2010-12-21 13:58:04
【问题描述】:

我在 gnuplot 的帮助下从 csv 文件中读取数据。大多数行有 8 列,其中一些有 9 列。每当有 9 列时,我想画一条垂直线(想想标记那个位置)。我可以用 gnuplot 实现吗?

【问题讨论】:

  • 好的,我发现了一个hack:取0作为默认值,如果有9列,则使用更高的值并绘制那条线。但是有没有更好的解决方案,因为额外的绘图破坏了图形的比例......

标签: gnuplot


【解决方案1】:

你可以使用(假设我在 x 轴上的点是 0.35,我想要整个 y 轴):

set arrow from 0.35,graph(0,0) to 0.35,graph(1,1) nohead

或者,如果你想在特定的 y 范围内显示这个{ymin,ymax}

set arrow from 0.35,ymin to 0.35,ymax nohead

如果你想自定义更多你可以使用:

set style arrow {idx:index} default 

set style arrow {idx:index} [ nohead | head | backhead | heads ] 

                            [ size {flt:length} [,{flt:angle}]

                                   [,{flt:backangle}] ] 

                            [ filled | empty | nofilled ] 

                            [ front | back ] 

                            [ [ linetype | lt {idx:type} ] 

                              [ linewidth | lw {int:width} ] 

                              | [ linestyle | ls {idx:style} ] ] 

有关 gnuplot 运行的更多信息:

help arrow

【讨论】:

  • 有什么方法可以自动获取 ymax/ymin?
【解决方案2】:

只需通过设置 yrange 来固定比例:

set yrange [##:##]

## 是某个数字的占位符:)

干杯,
B2S

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-08-01
    • 1970-01-01
    • 2011-01-30
    • 1970-01-01
    • 2014-01-08
    • 1970-01-01
    相关资源
    最近更新 更多