Changeset 36 for trunk/lib/Gnuplot.h


Ignore:
Timestamp:
Jan 13, 2006, 2:05:53 AM (16 years ago)
Author:
Jari Häkkinen
Message:

Changed Gnuplot interface. Fixed sever bug in Stats::accumulated(void).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/Gnuplot.h

    r31 r36  
    7272    ///
    7373    /// Plot the data \a y as a function of \a x using the Gnuplot
    74     /// 'plot' command. If \a replot is set to true, then the Gnuplot
    75     /// 'replot' command is used to create the plot.
     74    /// 'plot' command. The \a x vector can be omitted as in normal
     75    /// Gnuplot usage.
    7676    ///
    77     void plot_xy(const std::vector<double>& x, const std::vector<double>& y,
    78                  bool replot=false);
     77    inline void
     78    plot(const std::vector<double>& y,
     79         const std::vector<double>& x=std::vector<double>())
     80    { plot(y,x,"plot"); }
    7981
    8082    ///
    81     /// Plot the data in \a y using the Gnuplot 'plot' command. If \a
    82     /// replot is set to true, then the Gnuplot 'replot' command is
    83     /// used to create the plot.
     83    /// Plot the data \a y as a function of \a x using the Gnuplot
     84    /// 'replot' command. The \a x vector can be omitted as in normal
     85    /// Gnuplot usage.
    8486    ///
    85     void plot_y(const std::vector<double>& y, bool replot=false);
     87    inline void
     88    replot(const std::vector<double>& y,
     89           const std::vector<double>& x=std::vector<double>())
     90    { plot(y,x,"replot"); }
    8691
    8792  private:
     
    9297
    9398    void acquire_program_path(const std::string&);
     99
     100    ///
     101    /// @param \a plotcmd must be "plot" or "replot".
     102    ///
     103    void plot(const std::vector<double>& y, const std::vector<double>& x,
     104              const std::string& plotcmd);
     105
    94106    void tokenizer(const std::string& in, std::list<std::string>& tokens,
    95107                   const std::string& delimiters = ":");
Note: See TracChangeset for help on using the changeset viewer.