anchor.diff:      TypeToTimeAndBytes = average(Types, Times, Map1),
       lager:info("Average computed!"),
   
  -    %% Write average to files (one file per type)
  -    InputFiles = write_to_files(TypeToTimeAndBytes, EvalId, EvalNumber),
  +    %% Write average in files (one file per type) to `PlotDir`
  +    PlotDir = root_plot_dir() ++ "/"
  +           ++ atom_to_list(EvalId) ++ "/"
  +           ++ EvalNumber ++ "/",
  +    lager:info("Will write average .csv files and plot in directory: ~p", [PlotDir]),
  +
  +    InputFiles = write_to_files(TypeToTimeAndBytes, PlotDir),
  +    Titles = get_titles(Types),
  +    OutputFile = output_file(PlotDir)
       lager:info("Wrote average to files: ~p", [InputFiles]),
   
  -    Titles = get_titles(Types),
  -
  -    Result = run_gnuplot(InputFiles, Titles, EvalId, EvalNumber),
  -    _ = lager:info("Generating plot. Output: ~p", [Result]),
  +    Result = run_gnuplot(InputFiles, Titles, PlotDir),
  +    lager:info("Generating plot ~p. Output: ~p", [OutputFile, Result]),
       ok.
   
   %% @private
  
positive.code: 
  %% @private
  output_file(PlotDir) ->
      PlotDir ++ "/plot.pdf".
  
  %% @private
  only_dirs(Dir) ->
      lager:info("ONLY DIRS"),
      {ok, DirFiles} = file:list_dir(Dir),
  
      lager:info("FILES ~p", [DirFiles]),
  
      %% Ignore files
      Dirs = lists:filter(
          fun(Elem) ->
              filelib:is_dir(Dir ++ "/" ++ Elem)
          end,
          DirFiles
      ),
  
      lager:info("DIRS ~p", [Dirs]),
  
      Dirs.
  
  %% @private
  only_csv_files(LogDir) ->
  
negative.code: get_title(broadcast)  -> "Broadcast".
  
  %% @private
  run_gnuplot(InputFiles, Titles, OutputFile) ->
      Bin = case os:getenv("MESOS_TASK_ID", "false") of
          "false" ->
              "gnuplot";
  