anchor.diff:          [],
           LastKnown
       ).
  +
  +%% @private
  +generate_per_node_plot(Map, PlotDir) ->
  +    {Titles, InputFiles} = write_per_node_to_files(Map, PlotDir),
  +    OutputFile = output_file(PlotDir, "per_node"),
  +    Result = run_gnuplot(InputFiles, Titles, OutputFile),
  +    lager:info("Generating per node plot ~p. Output: ~p", [OutputFile, Result]).
  +
  +%% @private
  +write_per_node_to_files(Map, PlotDir) ->
  +	InputFileToTitle = orddict:fold(
  +        fun(FileLogPath, TimeToLogs, InputFileToTitle0) ->
  +            NodeName = node_name(FileLogPath),
  +
  +            orddict:fold(
  +                fun(Time, Logs, InputFileToTitle1) ->
  +                    lists:foldl(
  +                        fun({Bytes, Type}, InputFileToTitle2) ->
  +                            Title = Type ++ "_" ++ NodeName,
  +                            InputFile = PlotDir ++ Title ++ ".csv",
  +                            append_to_file(InputFile, Time, Bytes),
  +
  +                            case orddict:find(InputFile, InputFileToTitle2) of
  +                                {ok, _} ->
  +                                    InputFileToTitle2;
  +                                error ->
  +                                    orddict:store(InputFile, Title, InputFileToTitle2)
  +                            end
  +                        end,
  +                        InputFileToTitle1,
  +                        Logs
  +                    )
  +                end,
  +                InputFileToTitle0,
  +                TimeToLogs
  +            )
  +        end,
  +        orddict:new(),
  +        Map
  +    ),
  +
  +    {Titles, InputFiles} = orddict:fold(
  +        fun(InputFile, Title, {Titles0, InputFiles0}) ->
  +            {[Title | Titles0], [InputFile | InputFiles0]}
  +        end,
  +        {[], []},
  +        InputFileToTitle
  +    ), 
  +    {Titles, InputFiles}.
  +
  +%% @private
  +node_name(FileLogPath) ->
  +    Tokens = string:tokens(FileLogPath, "\/\."),
  +    NodeName = lists:nth(length(Tokens) - 1, Tokens),
  +    re:replace(NodeName, "@", "_", [global, {return, list}]).
  +
  +%% @private
  +generate_average_plot(Types, Times, Map, PlotDir) ->
  +    %% Do the average of `Map1`
  +    TypeToTimeAndBytes = average(Types, Times, Map),
  +    lager:info("Average computed!"),
  +    
  +    InputFiles = write_average_to_files(TypeToTimeAndBytes, PlotDir),
  +    Titles = get_titles(Types),
  +    OutputFile = output_file(PlotDir, "average"),
  +    Result = run_gnuplot(InputFiles, Titles, OutputFile),
  +    lager:info("Generating average plot ~p. Output: ~p", [OutputFile, Result]).
  +
   
   %% @private
   %% Do the average of all logs.
  
positive.code: 
  %% @private
  create_empty_dict_type_to_time_and_bytes(Types, Times) ->
      lists:foldl(
          fun(Type, Map0) ->
              lists:foldl(
                  fun(Time, Map1) ->
                      orddict:append(Type, {Time, 0}, Map1)
                  end,
                  Map0,
                  Times
  
negative.code: 
  %% @private
  assume_per_node(TimeToLogsIn, LastKnownIn, Times) ->
      TimeZero = lists:min(Times),
  
      {TimeToLogs, _} = lists:foldl(
          fun(Time, {TimeToLogsAcc, LastKnownAcc}) ->
              {Logs1, LastKnownAcc1} = case orddict:find(Time, TimeToLogsIn) of
  