Changeset 859


Ignore:
Timestamp:
Nov 20, 2009, 12:15:33 AM (14 years ago)
Author:
Jari Häkkinen
Message:

Addresses #97. Improvements to summary plot.

Location:
trunk/lib
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/Graph.cc

    r858 r859  
    3333    pls_.init();
    3434    pls_.adv(0);
    35     pls_.scolbg(0,100,0);
    36     pls_.rgb(255,0,0);
    3735    pls_.vsta();
    3836  }
     37
    3938
    4039  Graph::~Graph(void)
    4140  {
    4241  }
     42
    4343
    4444  bool Graph::date_xticks(void)
     
    4848
    4949
     50  void Graph::fgcolour(unsigned char r, unsigned char g, unsigned char b)
     51  {
     52    pls_.rgb(r,g,b);
     53  }
     54
     55
    5056  void Graph::plot(const std::vector<unsigned int>& x)
    5157  {
    52     pls_.wind(0, x.size(), 0, x.back());
    53     pls_.box("bcnstd", 100, 5, "bcnstv", 100, 5);
     58    pls_.wind(0, x.size(), 0, yrange_);
     59    pls_.box("bcnstv", 10, 1, "bcnstv", yrange_/5, 1);
    5460    for (unsigned int i=1; i<x.size(); ++i) {
    5561      pls_.join(i-1,x[i-1],i-1,x[i]);
     
    6773  double Graph::yrange(double ymax)
    6874  {
    69     return ymax;
     75    return yrange_=ymax;
    7076  }
    7177
  • trunk/lib/Graph.h

    r858 r859  
    4747    static bool date_xticks(void);
    4848
     49    void fgcolour(unsigned char r, unsigned char g, unsigned char b);
    4950    void plot(const std::vector<unsigned int>&);
    5051
     
    5657    plstream pls_;
    5758    static std::vector<std::string> xticks_;
     59    double yrange_;
    5860  };
    5961
  • trunk/lib/Stats.cc

    r858 r859  
    410410//    gp->plot(total);
    411411
    412 //    gp->command("unset multiplot");
    413 
    414412    return filename;
    415413  }
     
    429427//    gp->command("set key height 2");
    430428//    gp->linetitle(ss.str());
    431 //    gp->linestyle("steps 2");
    432 //    gp->plot(x);
     429    gp.fgcolour(255,255,0);
     430    gp.plot(x);
    433431
    434432    ss.str("");
     
    437435//    gp->command("set key height 4");
    438436//    gp->linetitle(ss.str());
    439 //    gp->linestyle("steps 3");
    440 //    gp->plot(x);
     437    gp.fgcolour(0,0,255);
     438    gp.plot(x);
    441439
    442440    ss.str("");
     
    445443//    gp->command("set key height 6");
    446444//    gp->linetitle(ss.str());
    447 //    gp->linestyle("steps 4");
    448 //    gp->plot(x);
     445    gp.fgcolour(0,255,0);
     446    gp.plot(x);
    449447
    450448    ss.str("");
     
    452450//    gp->command("set key height 0");
    453451//    gp->linetitle(ss.str());
    454 //    gp->linestyle("steps 1");
     452    gp.fgcolour(255,0,0);
    455453    gp.plot(total);
    456 
    457 //    gp->command("unset multiplot");
    458454  }
    459455
Note: See TracChangeset for help on using the changeset viewer.