|
From: Thomas S. <t.s...@fz...> - 2011-12-05 07:59:40
|
canavanin <canavanin <at> yahoo.se> writes: > Hi everyone > > I need to create a graph showing pairs of value. One item from each pair is > a single value, the other one is supposed to show a range of values (my idea > was to plot the mean value with error bars to indicate the range's max and > min, but I'm open to better ideas). The x-axis has no purpose other than > giving the names of the various categories (just like in a histogram) - all > that matters are the y-values. > > I am pretty sure I could create something like this (value pairs and > x-categories) using histograms, but boxes just strike me as wrong in this > case. > > Is there a way to create such a graph? If so, could you please point me in > the right direction? > > Thanks a lot for your time! > > PS: I have already asked this question on stackoverflow, but I guess it's > not really the right forum for gnuplot questions. There, however, I have > also included a rough sketch of my desired graph, and some further details. > The link is: http://stackoverflow.com/q/8371993/475845 > http://stackoverflow.com/q/8371993/475845 Thanks again! you need to plot something out of (y-)range to get the xtics labels at the right positions. then you plot a large black point shifted to the left and on top a slightly smaller colored point. the same applies to the points which a shifted to the right plus errorbars with point size '0'. reset set xrange [-1:3] set yrange [0:25] unset bars xoffset=0.2 plot "ts.dat" using 0:(-999):xticlabel(1) every 2 notitle, \ "" using ($0-xoffset):2 every 2 \ with points pointtype 7 pointsize 9 linecolor rgb 'black' notitle, \ "" using ($0-xoffset):2 every 2 \ with points pointtype 7 pointsize 8 linecolor rgb 'red' notitle, \ "" using ($0+xoffset):2 every 2::1 \ with points pointtype 7 pointsize 9 linecolor rgb 'black' notitle, \ "" using ($0+xoffset):2 every 2::1 \ with points pointtype 7 pointsize 8 linecolor rgb 'blue' notitle, \ "" using ($0+xoffset):2:3 every 2::1 \ with errorbars pointsize 0 linecolor rgb 'black' notitle |