Gnuplot Error Bars Color
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 gnuplot error bars style of this site About Us Learn more about Stack Overflow the company Business
Gnuplot Set Bars
Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask error bars gnuplot 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: Sign
Gnuplot Boxerrorbars
up Gnuplot types of error bars up vote 3 down vote favorite 1 Can we change the type of line used by gnuplot in the errorbars? This is my gnuplot code: set terminal postscript eps color set output '| epstopdf --filter --outfile=plot.pdf' set xlabel "Simulation days" set xtics nomirror set ylabel "Time (seconds)" set ytics nomirror set logscale y set key left gnuplot standard deviation top plot "data1.csv" using 1:($2/1000):($3/1000) with yerrorbars pt 5,\ "data2.csv" using 1:($2/1000):($3/1000) with yerrorbars pt 7 The error bars from the first plot are different from the second one. The first line is solid, but the second is dotted. Its possible to define the style of the error bar? plot gnuplot share|improve this question asked Jun 9 '14 at 9:22 mariolpantunes 597822 Oh, wow, did not know about the output '| ...'. +1 for teaching me that :) –Bernhard Jun 10 '14 at 15:01 add a comment| 1 Answer 1 active oldest votes up vote 2 down vote accepted In your case, the easiest option is to use the solid terminal option to have only solid lines: set terminal postscript eps color solid lw 3 set output '| epstopdf --filter --outfile=plot.pdf' set samples 10 set xrange [0:10] unset key plot '+' using 1:1:(0.2*$1) w yerrorbars, \ '' using 1:(1.5*$1):(0.1*$1) w yerrorbars Result with 4.6.4: Alternatively, you can use lt 1 lc 2 for the second plot, which selects the line pattern of the first linetype (which is solid), and the color of the
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
Gnuplot Candlesticks
About Us Learn more about Stack Overflow the company Business Learn more about
Gnuplot Set Style Fill
hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join gnuplot colors 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: Sign up Gnuplot change color of http://stackoverflow.com/questions/24117219/gnuplot-types-of-error-bars bars in histogram up vote 11 down vote favorite 6 is it possible to change the color of bars in a Gnuplot script dynamically? I have the following script reset fontsize = 12 set term postscript enhanced eps fontsize set output "bargraph_speedup.eps" set style fill solid 1.00 border 0 set style histogram set style data histogram set xtics rotate by -45 set grid ytics linestyle 1 http://stackoverflow.com/questions/12224545/gnuplot-change-color-of-bars-in-histogram set xlabel "Benchmarks" font "bold" set ylabel "Relative execution time vs. reference implementation" font "bold" set datafile separator "," plot 'bm_speedup.dat' using 2:xtic(1) ti "Speedup" linecolor rgb "#00FF00" which generates this plot: Is it possible to make the color of the bars which are below zero red? Thanks, Sven gnuplot histogram share|improve this question asked Sep 1 '12 at 3:00 Sven Hager 1,14721022 You might want to look into rgb variable -- adding a third column which specifies a green "linetype" or a red one depending on whether the value is positive or negative. –mgilson Sep 2 '12 at 23:09 add a comment| 4 Answers 4 active oldest votes up vote 6 down vote accepted You can mimic this behavior using the boxes style: My test data: zip 2 baz 2 bar -1 cat 4 foo -3 And then plotting with gnuplot: set style line 1 lt 1 lc rgb "green" set style line 2 lt 1 lc rgb "red" set style fill solid plot 'test.dat' u (column(0)):2:(0.5):($2>0?1:2):xtic(1) w boxes lc variable # #xval:ydata:boxwidth:color_index:xtic_labels share|improve this answer answered Sep 2 '12 at 23:37 mgilson 153k23250364 Seems like a solution! &
the last entry we had mean and standard variation data for five different conditions. Now let us assume that we have only two different conditions, but have measured with three different instruments A, B and C. We have used a ANOVA to verify that the data for the two conditions are significant different. As a result the plot in Fig. http://www.gnuplotting.org/tag/errorbars/ 1 should be created. Fig. 1 Plot the mean and variance of the given data (code to produce http://www.csse.uwa.edu.au/programming/gnuplot_demos/errorbar/errorbar.html this figure) Therefore we store our data in a format, that can be used by the index command in Gnuplot. Note that the data have two empty lines between the blocks in the real data file: # mean std # A 0.77671 0.20751 0.33354 0.30969 # B 0.64258 0.22984 0.19621 0.22597 # C 0.49500 0.31147 0.14567 0.21857 Now every instrument is stored in a different data block containing both conditions as columns. The color error bars definitions and axes settings are done in a similar way as in the previous blog entry. Note that we have to define two more colors for the boxes, because we use three different colors. Also we define a black line to plot the significance indicator (arrow). set style line 1 lc rgb 'gray30' lt 1 lw 2 set style line 2 lc rgb 'gray40' lt 1 lw 2 set style line 3 lc rgb 'gray70' lt 1 lw 2 set style line 4 lc rgb 'gray90' lt 1 lw 2 set style gnuplot error bars line 5 lc rgb 'black' lt 1 lw 1.5 set style fill solid 1.0 border rgb 'grey30' The significance indicator is created by three black arrows and a text label: # Draw line for significance test set arrow 1 from 0,1 to 1,1 nohead ls 5 set arrow 2 from 0,1 to 0,0.95 nohead ls 5 set arrow 3 from 1,1 to 1,0.95 nohead ls 5 set label '**' at 0.5,1.05 center For the plot the index command is used to plot first condition A, then B and then C by using block 0,1, and 2 respectively. The x-position of the boxes for instrument A are slightly shifted to the left, the ones for C to the right by subtracting or adding the value of bs. The value of bs has the width of one box in order to plot the boxes side by side. # Size of one box bs = 0.2 # Plot mean with variance (std^2) as boxes with yerrorbar plot 'statistics.dat' i 0 u ($0-bs):1:($2**2) notitle w yerrorb ls 1, \ '' i 0 u ($0-bs):1:(bs) t 'A' w boxes ls 2, \ '' i 1 u 0:1:($2**2) notitle w yerrorb ls 1, \ '' i 1 u 0:1:(bs) t 'B' w boxes ls 3, \ '' i 2 u ($0+bs):1:($2**2) notitle w yerrorb ls 1, \ '' i 2 u ($0+bs):1:(bs) t 'C' w boxes ls 4 Tags: ANOVA, border, boxes, data, errorbars, index Plotting simple statistical data September 9th, 2010 | No Comments If we have done a experiment in order to apply a significance test like a ANOVA to our measured data, we are interested in present
ylow and yhigh, default format)" plot "err.dat" with errorbars will result in (gif mode) # this should look the same set title "Demonstration of error bars (both ylow and yhigh)" plot "err.dat" using 1:2:3:4 with errorbars will result in (gif mode) set title "Demonstration 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 "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 "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