【问题标题】:How can I keep previous plot in gnuplot我怎样才能在 gnuplot 中保留以前的情节
【发布时间】:2023-01-23 03:12:52
【问题描述】:

需要在图上用圆圈标记,但不重叠


#set multiplot layout 2, 1 #  engage multiplot mode
#set multiplot
set font "arial,12" 

set autoscale

set datafile separator comma


#set offset 0,0,.5,.5
#set autoscale fix

set xtics out nomirror
set ytics out nomirror
unset border
set border 3
set format y "%0.04s %cV " 
set format x 


#set object circle at 5.2055,3430 size 25.5 lw 5 fc rgb "red"


$data <<EOD
3400,5.2055 
EOD

plot [3200:4400] "shurb/foo.csv"    u 1:2 w l lc rgb 'dark-green' title 'AP',\
    $data using 1:2 with circle lw 1 lc rgb 'red' notitle' ,
#unset multiplot
#set output

它只绘制第二个或第一个,所以我必须将它们合并到同一个图上。 如何用圆圈标记或合并这两个图?为什么我不能重叠它们。

【问题讨论】:

    标签: gnuplot


    【解决方案1】:

    也许我无法完全理解你正在尝试做的事情。你如何用一个 plot 命令得到两个 plot? 无需使用多图。只需使用单个数据点绘制数据文件和数据块$data。

    顺便说一下,您评论的#set object circle at 5.2055,3430 size 25.5 lw 5 fc rgb "red" 已经交换了 x 坐标和 y 坐标。因此,这个圆形对象在您的绘图中是不可见的。

    脚本:(适用于 gnuplot>=5.2.2)

    ### plot with circles
    reset session
    
    # create some test data
    set table $Test separator comma
        plot [3200:4400] '+' u 1:(sin($0/6)*cos($0/20)/2.8*0.005+5.205) w table
    unset table
    
    $data <<EOD
    3400, 5.2055
    EOD
    
    set datafile separator comma
    set format y "%.4f mV"
    set key noautotitle
    
    plot [3200:4400] $Test u 1:2 w l lc "dark-green", 
          $data u 1:2 w circle lw 1 lc "red"
    ### end of script
    

    结果:

    【讨论】:

      猜你喜欢
      • 2012-04-02
      • 1970-01-01
      • 2021-09-23
      • 2022-01-06
      • 1970-01-01
      • 1970-01-01
      • 2022-01-19
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多