2
1 Filled curves in gnuplot 1 set term cairolatex pdf 2 set output ’testout.tex’ 3 set style fill transparent solid 0.30 noborder 4 set style function filledcurves y1=0 5 set style line 1 lt 1 lw 3 lc rgb ”black” 6 set style line 2 lt 1 lw 3 lc rgb ”red” 7 set style line 3 lt 2 lc rgb ”black” 8 set style line 4 lt 1 lc rgb ”red” 9 set style line 5 lt 1 lc rgb ”black” 10 f(x,x0) = (x0 ** (2.00/3.00)+2.00 * x/3.00) ** (3.00/2.00) 11 delta = 0.5 12 tau = 1.0 13 epsilon = f(tau,delta)- f(tau,0) 14 upperBound(x) = f(x,delta)+f(tau,delta)- f(tau,0) 15 lowerBound(x) = f(x,delta)- f(tau,delta)+f(tau,0) 16 set xrange [0:1.5 * tau ] ; 17 set yrange [0:1.1 * f(1.5 * tau,delta)] 18 set ytics (’$ \ delta$ ’ delta) 19 set xtics (’$ \ tau$ ’ tau) 20 set arrow from tau,f(tau,0) to tau,f(tau,delta) heads ls 5 front 21 set label 1 ’$ \ varepsilon$ ’ at tau+0.05,f(tau,0)+epsilon/2.0 22 unset key 23 plot f(x,0) fs transparent lc rgb ”blue”, \ 24 f(x,delta) with lines ls 2, \ 25 f(x,0) with lines ls 1, \ 26 0 with lines ls 1, \ 27 upperBound(x) with lines ls 4, \ 28 lowerBound(x) with lines ls 4, \ 29 ’+’ using 1:(lowerBound($1)):(upperBound($1)) \ , 30 w filledcurves fs transparent lc rgb ”red”, \ 31 ’+’ using ($1+0.01):(lowerBound($1)):(upperBound($1)), \ 32 w filledcurves fs transparent lc rgb ”red” 1

Filled curves in gnuplot

Embed Size (px)

DESCRIPTION

Shows two ways of filling areas in gnuplot - one using filledstyle (fs) and one using the '+'-pseudofile and functions defined within the script. The second method contains some artifacts with pdf output, and is thus drawn twice to overlap for a more "smooth" drawing

Citation preview

Page 1: Filled curves in gnuplot

1 Filled curves in gnuplot

1 set term c a i r o l a t e x pdf2 set output ’ t e s t ou t . tex ’3 set style f i l l t ransparent s o l i d 0 .30 noborder4 set style function f i l l e d c u r v e s y1=05 set style l i n e 1 l t 1 lw 3 l c rgb ” black ”6 set style l i n e 2 l t 1 lw 3 l c rgb ” red ”7 set style l i n e 3 l t 2 l c rgb ” black ”8 set style l i n e 4 l t 1 l c rgb ” red ”9 set style l i n e 5 l t 1 l c rgb ” black ”10 f (x , x0 ) = ( x0 ∗∗ (2 .00/3 .00)+2 .00∗ x /3 . 0 0 )∗∗ ( 3 . 0 0 /2 . 0 0 )11 de l t a = 0 .512 tau = 1 .013 ep s i l o n = f ( tau , d e l t a )− f ( tau , 0 )14 upperBound (x ) = f (x , d e l t a )+ f ( tau , d e l t a )− f ( tau , 0 )15 lowerBound (x ) = f (x , d e l t a )− f ( tau , d e l t a )+ f ( tau , 0 )16 set xrange [ 0 : 1 . 5 ∗ tau ] ;17 set yrange [ 0 : 1 . 1 ∗ f ( 1 . 5∗ tau , d e l t a ) ]18 set ytics ( ’ $\ de l ta$ ’ d e l t a )19 set xtics ( ’ $\ tau$ ’ tau )20 set arrow from tau , f ( tau , 0 ) to tau , f ( tau , d e l t a ) heads l s 5 f r on t21 set label 1 ’ $\ va r ep s i l on$ ’ at tau+0.05 , f ( tau ,0)+ ep s i l o n /2 .022 unset key23 plot f (x , 0 ) f s t ransparent l c rgb ” blue ” ,\24 f (x , d e l t a ) with l i n e s l s 2 ,\25 f (x , 0 ) with l i n e s l s 1 ,\26 0 with l i n e s l s 1 ,\27 upperBound (x ) with l i n e s l s 4 ,\28 lowerBound (x ) with l i n e s l s 4 ,\29 ’+’ using 1 : ( lowerBound ( $1 ) ) : ( upperBound ( $1 ) )\ ,30 w f i l l e d c u r v e s f s t ransparent l c rgb ” red ” ,\31 ’+’ using ( $1 +0 .01 ) : ( lowerBound ( $1 ) ) : ( upperBound ( $1 ) ) ,\32 w f i l l e d c u r v e s f s t ransparent l c rgb ” red ”

1

Page 2: Filled curves in gnuplot

2