Upload
oldmorgan
View
30
Download
5
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
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
2