1

I want to plot experimental data with two error bars (statistics, and statistics+systematics) which can be done like this:

unset key
set xrange [0.5:5.5]
$data << EOD
1 1 0.1 0.2
2 2 0.1 0.3
3 3 0.1 0.4
4 4 0.1 0.5
5 5 0.1 0.6
EOD
plot "$data" u 1:2:3 lc 1 ps 1 with yerrorbars, \
     "" u 1:2:4 lc 1 ps -1 with yerrorbars

However, this will add small horizontal lines to both error bars. I would like to have only a vertical line for the total error, and small horizontal lines for the statistical error only. I can remove all small horizontal lines by adding

set errorbars small

But how can I have visible horizontal lines ("set errorbars large") for the first plot command, and no horizontal lines ("set errorbars small") for the second plot command, but all in the same plot?

The result should look like this: enter image description here

1
  • you could do a multiplot and overlay both plots (with different settings)... Commented Aug 21, 2018 at 14:02

1 Answer 1

2

For the plot without the horizontal lines, use with vectors instead of with yerrorbars:

unset key
set xrange [0.5:5.5]
$data << EOD
1 1 0.1 0.2
2 2 0.1 0.3
3 3 0.1 0.4
4 4 0.1 0.5
5 5 0.1 0.6
EOD
plot "$data" u 1:2:3 lc 1 ps 1 with yerrorbars, \
     "" u 1:($2-$4):(0):(2*$4) with vectors nohead lc 1

enter image description here

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.