Monday, 15 September 2014

Gnuplot--set label for points that exceed data range -



Gnuplot--set label for points that exceed data range -

my question how automate placing labels @ border of plot info points exceed range of plot. done points outliers that, if plotted, skew scale of plot such plot no longer useful, still need noted.

for example, let's i've got info file called 'mydata.dat' looks this:

1 2 3 3 7 4 8 6 50 8

if plot info using

set yrange [0:10] set xrange [0:10] plot 'mydata.dat' w lp pt 1

then lastly point (50,8) not plotted. acknowledge, however, there point outside plotted range, label , point placed @ border (i.e., @ 10,8) of plot using

set label "" @ 10,8 point pt 1 set label "50" @ 9.75,8 right

is there way automate process? way have gnuplot read entire info file , set points , labels @ border of plot?

to plot point outside of specified range, you'll need sec plot command using labels plotting style.

in using statement can check point beingness outside range. if is, place point corresponding label, otherwise skip point (using 1/0 value):

set xrange [0:10] set yrange [0:10] set linetype 1 pt 7 plot 'mydata.dat' w lp lt 1, \ '' using ($1 > 10 ? 10 : 1/0):2:(sprintf('%d', $1)) labels right offset -2,-0.25 point lt 1 notitle

here, check x-value beingness larger specified maximum x-value. maybe need adapt in order grab outliers in y-direction or smaller 0.

label range gnuplot

No comments:

Post a Comment