*===========================================================================
* focus.job: Frequency distribution of leaching concentration
*===========================================================================
* Variables:
* 1. The output file in the data statement
* 2. The compound name in the indentifier and title
*=========================================================================== 

xy -c focus.job -i Freq   -V -5,75,105,102
xy -c focus.job -i ConLea -V -5,50,105,77
xy -c focus.job -i AmaLea -V -5,25,105,52
xy -c focus.job -i FlvLiq -V -5,1,105,28

title '<RunName>' 14,97.5 1.3

common
fixed_size
escape=^
legend_columns 1
no_legendbox
open_graph
draw_bars 1
draw_lines 0
x_margin 0.05
char_width 1.25
end

AmaLea
include focus.job,common
data <PearlDataFile> 1 3 2 Target_<PearlSubstance>
x_text Year (a)
y_axis 0
title_1 Mass leached from FOCUS layer (kg ha^P-1^P)
end

FlvLiq
include focus.job,common
data <PearlDataFile> 1 1e3*$4 2 Target_<PearlSubstance>
x_text Year (a)
y_axis 0
title_1 Water percolated at bottom of FOCUS layer (mm)
end

ConLea
include focus.job,common
data <PearlDataFile> 1 5 2 Target_<PearlSubstance>
data <PearlDataFile> 7 $6+0.1*$6 3 ?77.5  2 ConLea_<PearlSubstance>
data <PearlDataFile> 7 $6+0.1*$6 3 ?82.5  2 ConLea_<PearlSubstance>
x_text Year (a)
y_axis 0
title_1 Concentration in leaching water (^Sm^Sg L^P-1^P)
text '(The arrow indicates 80th percentile)' L2,T-3 3
draw_markers 0 13 13 13
marker_size 5 5 5
no_legend
end

Freq
include focus.job,common
legend_pos Rr,B1
data <PearlDataFile> 6 3 2 ConLea_<PearlSubstance>
x_text Concentration in leaching water (^Sm^Sg L^P-1^P)
y_axis 0 100 5
title_1 Frequency distribution of concentration in leaching water (%)
draw_expression 80
legend Distribution '80th percentile (FOCUS target)'
legend_columns 1
x_margin 0
draw_bars 0
draw_lines 1 2
end