【问题标题】:Change color of only one data point in gnuplot在 gnuplot 中仅更改一个数据点的颜色
【发布时间】:2020-08-15 10:48:42
【问题描述】:

我正在 gnuplot 中制作 gif,并且我将数据分成块。我需要这些点是白色的,除了 just 每个数据块的第一行,这将是一个橙色点。

目前我的代码是:

#...
do for [i=0:int(STATS_blocks-1)]{
plot "positions.txt" index i pt 7 ps 0.5 lc 'white' title "t = ".((i+1)*200)." Myr"
}

如您所见,这会将每个数据点绘制为白色,包括第一行。

【问题讨论】:

    标签: for-loop animation gnuplot gif animated-gif


    【解决方案1】:

    已编辑以显示可变点大小

    如果我正确理解您的数据格式:

    set linetype 11 lc "orange"
    set linetype 12 lc "white"
    
    set style data points
    do for [i=0:N] {
      plot "positions.txt" index i using 1:2:(column(0)>0 ? 0.5 : 2.0):(column(0)>0 ? 12 : 11) pt 7 ps variable lc variable
    }
    

    可变颜色(如果使用)总是取自最后的using 列。其他变量属性从那里返回。

    【讨论】:

    • 太好了,效果很好。但是,如果我还想更改第一个元素的磅值并使其更大,比如 ps 15 而不是其余的 ps 7,该怎么办?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-06-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-08-15
    相关资源
    最近更新 更多