anchor.diff:      filelib:ensure_dir(PlotDir),
   
       generate_per_node_plot(Map1, PlotDir),
  -    generate_average_plot(Types, Times, Map1, PlotDir),
  +    generate_average_plot(Types1, Times, Map1, ConvergenceTime, PlotDir),
       ok.
   
   %% @private
  
positive.code: write_average_to_files(TypeToTimeAndBytes, PlotDir) ->
      lists:foldl(
          fun({Type, List}, InputFiles) ->
              InputFile = PlotDir ++ Type ++ ".csv",
  
              lists:foreach(
                  fun({Time, Bytes}) ->
  
negative.code:     [_ | Lines] = read_lines(FilePath, FileDescriptor),
  
      lists:foldl(
          fun(Line, {Map0, Types0, Times0, ConvergenceTimes0}) ->
              %% Parse log line
              [Type0, Time0, Bytes0] = string:tokens(Line, ",\n"),
              TypeA = list_to_atom(Type0),
              {TimeI, _} = string:to_integer(Time0),
              {BytesF, _} = string:to_float(Bytes0),
  
              {Map2, ConvergenceTimes2} = case TypeA of
                  convergence ->
                      ConvergenceTimes1 = ordsets:add_element(TimeI, ConvergenceTimes0),
                      {Map0, ConvergenceTimes1};
                  _ ->
                      %% Get dictionary that maps time to logs of this file
                      TimeToLogs0 = case orddict:find(FilePath, Map0) of
                          {ok, Value} ->
                              Value;
                          error ->
                              orddict:new()
                      end,
  
                      %% Update dictionary `TimeToLogs0` adding new pair log to
                      %% the list of logs mapped to time `TimeI`
                      TimeToLogs1 = orddict:append(TimeI, {BytesF, TypeA}, TimeToLogs0),
  
                      %% Update dictionary `Map0` with new value `TimeToLogs1`
                      Map1 = orddict:store(FilePath, TimeToLogs1, Map0),
                      {Map1, ConvergenceTimes0}
              end,
  
              %% Update set of types
              Types1 = ordsets:add_element(TypeA, Types0),
              %% Update set of times
              Times1 = ordsets:add_element(TimeI, Times0),
  
              {Map2, Types1, Times1, ConvergenceTimes2}
          end,
          {Map, ordsets:new(), ordsets:new(), ordsets:new()},
          Lines
      ).
  
  