function plotTerrain(terrain, water)
    % Creates a figure with the given terrain (and water).
    %
    % water is optional.  If given, it should have same
    % dimensions as terrain.
    if nargin == 2
        combined = terrain+water;
        combined(water == 0) = 0;  % if no water, don't draw any blue
        bar3(combined,0.95,'b');
        alpha(0.7);
        hold on;
    end
    bar3(terrain+0.05,1,'g');
    view([21 56]);
    axis([0 1+size(terrain,2) 0 1+size(terrain,1) -1 1+max(max(terrain))]);
    hold off;
   
