clear all
close all

%       SLC                     MillD  Prlys LkOut LouMdw Frmin DryFrk Timpa Bright Thayn

snow = [3,    4,    10,   11    60,    55,   82,   51,    88,   45,    80,   60,    68] .* 0.0254;
      
elev = [4226, 4209, 4514, 4490, 8967,  7500, 8200, 6700,  8000, 7093,  8140, 8750,  9230] .* 0.3048;

hgt1 = [1260:10:1580];
hgt2 = [1580:10:2800];
hgt3 = [2800:10:3360];

hgt_min = 1264.8;
hgt_max = 2800;
hgt_ben = 1584;

slope_valley = (0.28-0.127)/(hgt_ben-hgt_min);    % Snow increase w/ height from base to benches.
slope_mtn = (2.16-0.28)/(hgt_max-hgt_ben);        % Snow increase w/ height from benches to mountaintops.

valley_fit = (hgt1-hgt_min) * slope_valley + 0.127;
mtn_fit = (hgt2-hgt_ben) * slope_mtn + 0.28;
peak_fit = 2.16 * ones(length(hgt3));

figure(1)
plot(snow,elev,'k.','MarkerSize',15)
hold on
plot( valley_fit,hgt1,'linewidth',2)
hold on
plot(mtn_fit,hgt2, 'linewidth',2)
hold on
plot(peak_fit,hgt3, 'linewidth',2)
legend('Observations','Valley Fit','Mountain Fit','Peak Fit','location','southeast')
xlabel('Snow Depth (m)')
ylabel('Elevation (m)')

figureHandle = gcf;
%# make all text in the figure to size 14 and bold
set(findall(figureHandle,'type','text'),'fontSize',12)