Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

coloring the errorbar part on a histogram

817 views
Skip to first unread message

bryan

unread,
Jun 29, 2010, 5:26:15 PM6/29/10
to
in the example on my previous post, i want to color the errobar part
black like the border of the bar and leave the fill style red. the
errorbar demo has all the same color errors (red). i cannot get 'set
style errorbars' to color it black without changing other things, so
now i'm not sure what to focus on to get it to work.


(previous post:)

http://groups.google.com/group/comp.graphics.apps.gnuplot/browse_thread/thread/3240398c95867b6e

Péter Juhász

unread,
Jun 29, 2010, 6:47:46 PM6/29/10
to
> http://groups.google.com/group/comp.graphics.apps.gnuplot/browse_thre...

Currently you'll have to plot the data twice, once with boxes and once
with errorbars to get what you want.
In future versions the errorbars for the boxerror style will be
colored the same as the border color, not as the fill color.
(this was just changed in the cvs version)

Péter Juhász

bryan

unread,
Jun 30, 2010, 3:50:41 PM6/30/10
to
On Jun 29, 6:47 pm, Péter Juhász <peter.juhas...@gmail.com> wrote:
> Currently you'll have to plot the data twice, once with boxes and once
> with errorbars to get what you want.

oh, i see! - i am learning that you can put different specs after
'plot'

for [i=0:1] 'data_1.dat' u 1:2:3:xticlabel(4) every ::i w boxerror
notitle lw 2 lc 1,
for [i=2:2] '' u 1:2 every ::i notitle lc -1 ps 0 lw 0,
for [i=3:4] 'data_1.dat' u 1:2:3:xticlabel(4) every ::i w boxerror
notitle lw 2 lc 2,
for [i=0:1] '' u 1:2:3 every ::i w boxerror fill empty notitle lw 2 lc
-1,
for [i=3:4] '' u 1:2:3 every ::i w boxerror fill empty notitle lw 2 lc
-1

... wondering though how to plot only the "plus error", or "error on
the positive side of the measurement" -- putting the 'black outline'
code first generates the same thing as before.

-bryan

sfeam

unread,
Jun 30, 2010, 7:06:32 PM6/30/10
to
bryan wrote:

I'm not sure what was the earliest version of gnuplot to support it,
but there is an attribute front/back that applies to the error bars.
If the error bars are drawn in back, then the downward leg of the bar
is occluded by a solid box drawn in front of it. If the error bars are
drawn in front of the box, then both the upward and downward legs are
visible.

set bars back


Péter Juhász

unread,
Jul 1, 2010, 2:46:14 AM7/1/10
to

... or just use the 4-column form of 'yerrorbars' which lets you
specify absolute values for the positive and negative errorbar.

By the way, those 'for [i=3:4] ... every ::i' things can be more
concisely written as 'every ::3::4'.

0 new messages