maxemilian
maxemilian

Reputation: 416

How can I keep previous plot in gnuplot

Need to mark with circle on graph, but it doesn't overlap

enter image description here enter image description here


#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

It is only drawing second one or first one, so I have to merge them on same plot. How can I mark with circle or merge these two plots? Why I couldn't overlap them.

Upvotes: 1

Views: 116

Answers (1)

theozh
theozh

Reputation: 25714

Maybe I cannot fully follow what you are trying to do. How do you get two plot with a single plot command? There is no need to use multiplot. Simply plot your datafile and your datablock $data with a single datapoint.

By the way, your commented #set object circle at 5.2055,3430 size 25.5 lw 5 fc rgb "red" has swapped x-, and y-coordinates. So, this circle object would not be visible on your plot.

Script: (works with 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

Result:

enter image description here

Upvotes: 2

Related Questions