Asymmetric Error Bars Gnuplot
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 Business Learn more about gnuplot error bars histogram hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges gnuplot error bars color 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.
Gnuplot Error Bars With Lines
Join them; it only takes a minute: Sign up Gnuplot asymmetric xy errorbars up vote 3 down vote favorite I need some help with Gnuplot 4.4 - I've been trying to get 2D data scatter plotted with errorbars
Gnuplot Error Bars Style
in both the x and y dimensions. Both x and y dimensions have high/low errorbars, that is the errorbars are not symmetric, so each data point uses six values (x,y,xlow,xhigh,ylow,yhigh). Gnuplot's man pages say this is possible and I've found examples on the net - both cases suggest using data files with six records for each data point (the (x,y,xlow,xhigh,ylow,yhigh) format) but I can't for the life of me get Gnuplot to behave. The best I can do how to plot error bars in gnuplot when plotting a single test point (1.0 3.0 0.25 0.5 0.25 0.5) is to get a plot of the test point with disembodied errorbars floating in nearby space. gnuplot share|improve this question edited May 31 '12 at 1:40 Dan 5,13652056 asked May 30 '12 at 21:11 user1427035 1612 Can you post some example code/data which illustrate your problem? –andyras May 30 '12 at 21:43 add a comment| 1 Answer 1 active oldest votes up vote 4 down vote The reason your error bars are "disembodied" is that your x (1.0) is not between xlow (.25) and xhigh (.5). Your y (3.0) is also not between your ylow (.25) and yhigh (0.5). If you want the lows and highs to represent the difference from the central variable, you should use a command like this: plot "test.dat" u 1:2:($1-$3):($1+$4):($2-$5):($2+$6) with xyerrorbars t "test point" Running this on your test file, I get the following plot: share|improve this answer answered May 30 '12 at 23:39 Dan 5,13652056 1 I wonder why it is implented this way in gnuplot. Errorbars should never be "disembodied" and it's more work to write value + error than just error. –con-f-use Apr 27 '15 at 15:33 @con-f-use: Error bars could in general be asymmetric. –Dan Jul 26 at 22:13 add a comment| Your Answer draft saved draft discarded Sign up or log in S
ylow and yhigh, default format)" plot "err.dat" with errorbars will result in (gif mode) # this
Gnuplot Errorbars
should look the same set title "Demonstration of error bars (both gnuplot x1y2 ylow and yhigh)" plot "err.dat" using 1:2:3:4 with errorbars will result in (gif mode) set title "Demonstration gnuplot standard deviation of boxes" plot "err.dat" with boxes will result in (gif mode) set title "Demonstration of boxerrorbars" plot "err.dat" with boxerror will result in (gif mode) set title http://stackoverflow.com/questions/10824336/gnuplot-asymmetric-xy-errorbars "Demonstration of xybars" plot "err.dat" using 1:2:3:4:5 with xybars will result in (gif mode) set autoscale set title "Demonstration of error bars (both ylow and yhigh)" set xlabel "Date\nTime" set timefmt "%y%m%d" set xdata time set key right set format x "%m/%d\n%y" plot "futures.dat" using 2:3:4:5 with errorbars will result in (gif mode) set title http://www.csse.uwa.edu.au/programming/gnuplot_demos/errorbar/errorbar.html "Demonstration of financebars" plot "futures.dat" using 2:3:4:5:6 with financebars will result in (gif mode) set title "Demonstration of candlesticks" plot "futures.dat" using 2:3:4:5:6 with candlesticks will result in (gif mode) set xrange [-3:65] set yrange [ 4:14] set timefmt "" set xdata "" set xlabel "" set format x "" set tics set title "Demonstration of error bars (only ydelta)" plot "err.dat" using 1:2:5 with errorbars will result in (gif mode) set title "Plot data file twice to get lines and errorbars" plot "err.dat" with lines, "err.dat" using 1:2:3:4 with errorbars will result in (gif mode) set logscale y set title "Demonstration of error bars (only ydelta) with y logscale" plot [-3:65] [1:100] "err.dat" using 1:2:5 with errorbars set nologscale y will result in (gif mode) set logscale x set title "Demonstration of error bars (only ydelta) with x logscale" plot [1:100] [4:14] "err.dat" using 1:2:5 with errorbars set nologscale x will result in (gif mode) set autoscale set nologscale set title "" woo@playfair.stanford.edu
from GoogleSign inHidden fieldsSearch for groups or messages
can use .pdf, .png and .jpg figures. Postscript and PDF figures scale well when included in a document. Bitmapped formats may give a blocky appearance if they have too low a resolution. Common ways to make figures and plots are: Use a graphical plotting program such as veusz, xmgrace, openoffice.org to make a plot. fv can also make simple plots, but requires the XANADU package (see the Users' Guide to set this up). Use a command-line based program such as gnuplot, sm (Supermongo), idl. qdp is also available in the XANADU package. Create images from astronomical FITS files using ds9 or fv. Convert between formats with convert, gimp, jpeg2ps or xv. Draw line diagrams with inkscape, xfig or openoffice.org/staroffice (draw package). Produce line and bitmap graphics from your program with the pgplot library. Generate plots from Python programs using matplotlib, veusz or chaco modules. Draw bitmapped images with the gimp (good for photo manipulation). Quite often you'll want to write a data file from your program and plot it using a plotting applications. Veusz Veusz is my own plotting package. It has a easy to use interface and can also be scripted. You can run it with the veusz command on Linux: > veusz Here is a quick guide to plotting some data: Suppose you have a data file consisting of your data, e.g. in test.dat: 0 0 1 1 2 4 3 9 5 25 Read you data by going to the menu option `Data, Import'. Enter your filename in the filename box. You can enter `x y' as the names for the columns in the dataset names box (you can use any names, but this is easier). Click import to get the data. If you wanted to plot error bars, add `+-' (symmetric) or `+ -' (asymmetric, note space) to either or both of the names, and add further columns to the data file. You can also plot data using CSV files saved from spreadsheets or FITS files. Click the `Plot points' button, which looks like a scatter-plot (or go to `Insert, Add xy' on the menu). Choose the names of the datasets in the properties tab (if you didn't use `x' and `y' when importing). Modify the appearance of the