Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Gnuplot types of error bars

Tags:

plot

gnuplot

Can we change the type of line used by gnuplot in the errorbars? This is my gnuplot code:

set terminal postscript eps color
set output '| epstopdf --filter --outfile=plot.pdf'
set xlabel  "Simulation days"
set xtics nomirror
set ylabel  "Time (seconds)"
set ytics nomirror
set logscale y
set key left top
plot "data1.csv" using 1:($2/1000):($3/1000) with yerrorbars pt 5,\
"data2.csv" using 1:($2/1000):($3/1000) with yerrorbars pt 7

The error bars from the first plot are different from the second one. The first line is solid, but the second is dotted. Its possible to define the style of the error bar?

like image 793
mariolpantunes Avatar asked Jul 04 '26 06:07

mariolpantunes


1 Answers

In your case, the easiest option is to use the solid terminal option to have only solid lines:

set terminal postscript eps color solid lw 3
set output '| epstopdf --filter --outfile=plot.pdf'

set samples 10
set xrange [0:10]
unset key

plot '+' using 1:1:(0.2*$1) w yerrorbars, \
     '' using 1:(1.5*$1):(0.1*$1) w yerrorbars

Result with 4.6.4:

enter image description here

Alternatively, you can use lt 1 lc 2 for the second plot, which selects the line pattern of the first linetype (which is solid), and the color of the second one:

plot '+' using 1:1:(0.2*$1) w yerrorbars, \
     '' using 1:(1.5*$1):(0.1*$1) lt 1 lc 2 w yerrorbars
like image 170
Christoph Avatar answered Jul 06 '26 20:07

Christoph



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!