Gnuplot Histogram Y Error Bars
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company gnuplot histogram error bars Business Learn more about hiring developers or posting ads with us Stack Overflow Questions
Gnuplot Boxerrorbars
Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million
Gnuplot Error Bars Style
programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Gnuplot barchart histogram with errorbars up vote 7 down vote favorite 2 I want to the results of my benchmarks. I
Set Bars Gnuplot
compare two virtual machines with each other and have data of the following form: BENCHMARK VM1_TIME VM1_ERROR VM2_TIME VM2_ERROR I want to generate a barchart diagram from this data which should look like this: Could somebody provide the code how to do this? I know this kind of request is unbeloved, but I really need this and googled for something like 2 hours, without a satisfactoring result. Thanks in advance, Sven gnuplot bar-chart share|improve gnuplot error bars standard deviation this question asked Aug 19 '12 at 2:25 Sven Hager 1,14721022 1 What about sharing your data, or offering some mock data, to play with? –vaettchen Aug 19 '12 at 2:55 I do not have concrete data yet because I need to know in what format Gnuplot wants it. However, it is clear that I have 5 columns of data: 1) Benchmark name 2) Time it took VM 1 to compute it (in milliseconds) 3) Time it took VM 2 to compute it (in milliseconds) 4) Error of VM 1 times (in milliseconds) 5) Error of VM 2 times (in milliseconds) –Sven Hager Aug 19 '12 at 13:02 If you want help, you need to provide data in a way that can easily copied & pasted - dput( mydata ) is always good. It will also be a good idea to provide the code you have tried that got you close but did not work. This is not only a matter of courtesy but also helps to avoid misunderstandings in terms of data structure, objectives etc. –vaettchen Aug 19 '12 at 13:46 1 possible duplicate of adding error bar to histogram in gnuplot –mgilson Aug 19 '12 at 23:23 1 Of possible interest: Adding error bars on a bar graph in g
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies gnuplot xyerrorbars of this site About Us Learn more about Stack Overflow the company candlesticks gnuplot Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges gnuplot bar chart Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: http://stackoverflow.com/questions/12023736/gnuplot-barchart-histogram-with-errorbars Sign up Adding error bars on a bar graph in gnuplot up vote 7 down vote favorite 2 I have the following file I want to plot using gnuplot bar graphs: Function X X-ERROR Y Y-ERROR A 1.311539 0.066268 1.000000 0.000000 (a1,b0) 1.325429 0.083437 1.010926 0.016710 (a.9,.b1) 1.134640 0.040017 1.276168 0.060281 (a.8,.b2) 1.078336 0.058529 1.346358 0.054645 (a.7,.b3) 1.035866 0.060660 1.318395 0.018087 (a.6,.b4) http://stackoverflow.com/questions/11347444/adding-error-bars-on-a-bar-graph-in-gnuplot 0.982717 0.047363 1.196714 0.047427 (a.5,.b5) 0.962423 0.051994 1.127991 0.044731 (a.4,.b6) 0.953673 0.046014 1.139608 0.044726 (a.3,.b7) 0.948948 0.050462 1.169209 0.044333 (a.2,.b8) 0.941013 0.047166 1.198138 0.045844 (a.1,.b9) 0.929961 0.057801 1.328111 0.088813 (a0,b1) 0.966331 0.036079 3.289381 0.213192 B 1.000000 0.000000 3.321802 0.121290 I can manage to plot the graph perfectly using: plot 'file.dat' using 4:xtic(1) title col, \\ '' using 2:xtic(1) title col; However I would like to use columns 3 and 5 to represent the interval of confidence that I always calculated. Any help? Thanks! gnuplot share|improve this question edited Jul 5 '12 at 15:25 Sirko 42.5k1069105 asked Jul 5 '12 at 15:20 Dynelight 7622833 add a comment| 2 Answers 2 active oldest votes up vote 9 down vote accepted Assuming you want to draw side-by-side bar charts with associated error bars, I would use the following: set xrange [-0.5:12.75] set xtic rotate by -45 set boxwidth 0.25 plot 'file.dat' using ($0-.05):4:5:xtic(1) with boxerrorbars title col, \\ '' using ($0+0.25):2:3 with boxerrorbars title col The idea is just to offset one of the two measures on the x-axis. share|improve this answer answered Jul 9 '12 a
30.34 22.58 161.08 2011-01-15 23.83 20.33 104.00 2011-01-22 50.50 16.17 79.75 2011-01-29 67.59 21.74 99.25 2011-02-05 37.58 33.33 155.33 2011-02-12 48.17 44.33 66.00 2011-02-19 89.34 12.42 91.42 2011-02-26 113.09 35.83 123.34 2011-04-02 174.25 http://psy.swansea.ac.uk/staff/carter/gnuplot/gnuplot_histograms.htm 105.25 221.25 2011-04-09 98.09 55.92 109.00 2011-04-16 98.67 30.83 202.00 2011-04-23 87.17 58.25 127.09 2011-04-30 139.74 67.33 232.84 2011-04-30 20.0 10.0 30.0 Note that there are two entries (the last two lines) https://forums.manning.com/posts/list/18499.page for 2011-04-30; this is intentional (to demonstrate a point about time-based x values). As described in my page on time-based histograms, gnuplot does not support date/time values (as opposed to labels) for the error bars x axis. Hence, there is no gap where March should be, and 2011-04-30 appears twice in the following plots. Try using set xdata time and you'll see what I mean; you'll get the error message "need full using spec for x time data". Similarly, set timefmt and set xdata time will have no effect. The following plot commands are common to all four of the histograms gnuplot error bars shown in this page. clear reset unset key # Make the x axis labels easier to read. set xtics rotate out # Select histogram data set style data histogram # Give the bars a plain fill pattern, and draw a solid line around them. set style fill solid border Clustered With the clustered style, one column in the data file corresponds to one bar in the plot, whilst the lines of the data file correspond to the clusters of the bars. Thus, using the following plot commands, we get three bars in each cluster, and one cluster for each row (notice the two clusters for 2011-04-30, which is what we expect). set style histogram clustered plot for [COL=2:4] 'date_mins.tsv' using COL:xticlabels(1) title columnheader Figure 1: Clustered Histogram Note the use of the for feature. This allows us to select multiple columns (2 to 4, in this case); without the for, we'd only be able to plot one column of data (using something like plot 'date_mins.tsv' using 3:xticlabels(1)), which defeats the purpose of the clustered histogram: Errorbars The next histogram type is errorbars. For this, gnuplot can accept up to three columns for y values: the
unable to make a simple form of bar graph, similar to Figure 5.9, but with error bars. A simple example: http://www.psyccomm.com/kent/Voting_by_Age.jpg Is this kind of graph possible with gnuplot? It seems like it has to be, but I've spent several hours now with the book and other sources. Referring to Figure 5.9, I'd be happy if there was only one histogram (eg election returns OR campaign spending), as long as each "party" had their own error measurement. Thanks! “„ philipp.janert (274) Offline Jun 9, 2009 @ 8:45 AM #2 Re: histograms clustered and errorbars Yes, you can achieve this effect, but it takes a certain amount of trickery. Imagine a data file like this: # x y1 e1 y2 e2 1 3 0.1 5 0.1 2 4 0.1 3 0.1 3 6 0.1 2 0.1 4 5 0.1 2 0.1 5 4 0.1 4 0.1 First column: x value Second column: y1 value Third column: error1 value Fourth column: y2 value Fifth column: error2 value Now you do this: set boxwidth 0.25 plot "data" u 1:2:3 w boxerrorbars, "" u ($1+0.25):4:5 w boxerrorbars and there you are...! The boxerrorbars style does what you want: boxes with little errorbars on top. To get the two histograms side-by-side, I adjusted the boxwidth (making it narrower) and then shifting the horizontal position of the second set of boxes by one box-width to the right. “„ robw (2) Offline Jun 9, 2009 @ 8:54 AM #3 Re: histograms clustered and errorbars Fantastic I would never have figured this out, and had more or less given up, but I even see now how you extend this technique for groups of more than two. Thanks, I'm glad I bought your book! “„ philipp.janert (274) Offline Jun 9, 2009 @ 9:04 AM #4 Re: histograms clustered and errorbars Your welcome. Ph. “„ phinnutz (1) Offline Mar 2, 2011 @ 5:46 PM #5 Re: histograms clustered and errorbars You can also use "set style histogram errorbars" For example, for data file: #Attribute Old-val old-std-dev New-val new-std-dev A 4 0.3 10 0.6 B 6 0.5 12 1.4 you can use: file="the-above-file-name" set style histogram errorbars set