Changeset 1026 for trunk/lib/Stats.cc


Ignore:
Timestamp:
Jan 11, 2010, 5:11:51 AM (14 years ago)
Author:
Peter Johansson
Message:

create anchor plot if anchor_format is different from format. refs #279

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/Stats.cc

    r1008 r1026  
    361361  }
    362362
     363
    363364  std::string Stats::plot(const std::string& filename,
    364365                          const std::string& linetype) const
    365366  {
    366     if (Configuration::instance().image_format()=="none")
     367    const std::string& format = Configuration::instance().image_format();
     368    if (format=="none")
    367369      return filename;
     370    plot(filename, linetype, format);
     371    const std::string& anchor_format =
     372      Configuration::instance().image_anchor_format();
     373
     374    if (format!=anchor_format)
     375      plot(filename, linetype, anchor_format);
     376    return filename;
     377  }
     378
     379
     380  void Stats::plot(const std::string& filename,
     381                   const std::string& linetype,
     382                   const std::string& format) const
     383  {
    368384    assert(total_stats().size());
    369     Graph gp(filename+"."+Configuration::instance().image_format(),
    370              Configuration::instance().image_format());
     385    Graph gp(filename+"."+format, format);
    371386    const Author2Vector* stat=NULL;
    372387    if (linetype=="total")
     
    428443    gp.current_color(255,0,0);
    429444    gp.plot(total, "total", get_back(*stat, "all"));
    430 
    431     return filename;
    432445  }
    433446
     
    435448  void Stats::plot_summary(const std::string& filename) const
    436449  {
    437     if (Configuration::instance().image_format()=="none")
    438       return;
    439     Graph gp(filename+"."+Configuration::instance().image_format(),
    440              Configuration::instance().image_format());
     450    const std::string& format = Configuration::instance().image_format();
     451    if (format=="none")
     452      return;
     453    plot_summary(filename, format);
     454    const std::string& anchor_format =
     455      Configuration::instance().image_anchor_format();
     456
     457    if (format!=anchor_format)
     458      plot_summary(filename, anchor_format);
     459  }
     460
     461
     462  void Stats::plot_summary(const std::string& filename,
     463                           const std::string& format) const
     464  {
     465    Graph gp(filename+"."+format, format);
    441466    std::vector<unsigned int> total = get_vector(total_stats(), "all");
    442467    double yrange_max=1.03*total.back()+1;
Note: See TracChangeset for help on using the changeset viewer.