Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>If you didn't want the arrow head then you might try the impulses style (with impulses rather than with lines) (If you still want the lines on top then you can plot twice).</p> <p>If you really want the arrow heads then the following might help: It uses a for loop (or sorts) to add vertical arrows to a plot.</p> <p><a href="https://stackoverflow.com/questions/4062999/gnuplot-script-for-loop-within-or-adding-to-existing-plot/4115145#4115145">Gnuplot script, for loop within or adding to existing plot</a></p> <p>Specifically: </p> <p>create a file simloop.gp which looks like the following:</p> <pre><code>count = count+1 #save the count to count.gp system 'echo '.count.' &gt; count.gp' #load the simloop shell system "./simloop.sh" #draw the arrow load 'draw_arrow.gp' if(count&lt;max) reread </code></pre> <p>Then create a simloop.sh file that looks something like so</p> <pre><code>#!/bin/bash #read the count count=$(awk -F, '{print $1}' count.gp) #read the file xcoord=$(awk -v count=$count -F, 'BEGIN{FS=" ";}{ if(NR==count) print $1}' simulation.dat) ycoord=$(awk -v count=$count -F, 'BEGIN{FS=" "}{ if(NR==count) print $2}' simulation.dat) dir=$(awk -v count=$count -F, 'BEGIN{FS=" "}{ if(NR==count) print $3}' simulation.dat) #choose the direction of the arrow if [ \"$dir\" == \"0\" ]; then echo '' &gt; draw_arrow.gp fi if [ \"$dir\" == \"1\" ]; then echo 'set arrow from ' $xcoord' ,0 to '$xcoord','$ycoord' head' &gt; draw_arrow.gp fi if [ \"$dir\" == \"2\" ]; then echo 'set arrow from '$xcoord',0 to '$xcoord','$ycoord' backhead' &gt; draw_arrow.gp fi </code></pre> <p>Then create a simulation.gp file that looks something like so:</p> <pre><code>count = 0; max = 5; load "simloop.gp" set yrange[0:*] plot "simulation.dat" u 1:2 w l </code></pre> <p>Make sure the shell file has executable permissions (chmod +wrx simloop.sh), load up gnuplot and type</p> <pre><code>load "./simulation.gp" </code></pre> <p>This worked for me with the data file </p> <pre><code>1 99 0 2 92.7 1 3 100.3 2 4 44.2 0 5 71.23 1 </code></pre> <p>(For testing I got rid of the time formatting You should be able to put it back without too much trouble.)</p> <p>Then I got this graph: <img src="https://i.stack.imgur.com/uGPtp.png" alt="enter image description here"></p> <p>Which I think is more or less what you want.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload