Changeset 863 for trunk/lib/Graph.cc


Ignore:
Timestamp:
Nov 20, 2009, 7:21:17 PM (12 years ago)
Author:
Jari Häkkinen
Message:

Addresses #97. Fixed background, added doxygen and other comments.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/Graph.cc

    r860 r863  
    2828
    2929  Graph::Graph(const std::string& filename)
     30    : plots_(0), pls_(1,1,"svg",filename.c_str())
    3031  {
    31     pls_.sdev("svg");
    32     pls_.sfnam(filename.c_str());
     32    // we use colour map 0 position 0 for background colour
     33    pls_.scolbga(230,230,230,1);
    3334    pls_.init();
    3435    pls_.adv(0);
     
    4849
    4950
    50   void Graph::fgcolour(unsigned char r, unsigned char g, unsigned char b)
     51  void Graph::current_colour(unsigned char r, unsigned char g, unsigned char b)
    5152  {
    52     pls_.rgb(r,g,b);
     53    // we use colour map 0 position 1 for current colour
     54    pls_.scol0a(1,r,g,b,1.0);
     55    pls_.col0(1);
    5356  }
    5457
     
    5760  {
    5861    pls_.wind(0, x.size(), 0, yrange_);
    59     pls_.box("bcnstv", 10, 1, "bcnstv", yrange_/5, 1);
     62    if (!plots_) {
     63      // draw plot frame, x and y ticks only for the first plot
     64      pls_.scol0a(2,0,0,0,1.0);
     65      pls_.col0(2);
     66      pls_.box("bcnstv", 10, 1, "bcnstv", yrange_/5, 1);
     67      pls_.col0(1);
     68    }
     69    ++plots_;
    6070    for (unsigned int i=1; i<x.size(); ++i) {
    6171      pls_.join(i-1,x[i-1],i-1,x[i]);
Note: See TracChangeset for help on using the changeset viewer.