Skip to content
Snippets Groups Projects
dualplot.hpp 2.78 KiB
Newer Older
  • Learn to ignore specific revisions
  • //**************************************************************************************************
    //*  FRIDA: fast reliable interactive data analysis                        
    //*  (C) Joachim Wuttke 1990-, v2(C++) 2001-                                
    //*  http://apps.jcns.fz-juelich.de/frida                                   
    //**************************************************************************************************
    
    Wuttke, Joachim's avatar
    ..  
    Wuttke, Joachim committed
    
    
    Wuttke, Joachim's avatar
    Wuttke, Joachim committed
    //! \file  dualplot.hpp
    
    //! \brief Collection NPlot of plot frames CPlot.
    
    Wuttke, Joachim's avatar
    Wuttke, Joachim committed
    #include "axis.hpp"
    
    
    //! One plot frame.
    
    Wuttke, Joachim's avatar
    ..  
    Wuttke, Joachim committed
    
    
    class CPlot {
    
        int iPlot;             //!< The index of this frame in NPloWin::Plots.
        CAxis X;               //!< Limits, log flag &c for x axis.
        CAxis Y;               //!< Limits, log flag &c for y axis.
    
    Wuttke, Joachim's avatar
    ..  
    Wuttke, Joachim committed
        // For data plotting:
    
        int maxpoints;         //!< Maximum # points to be plotted without reduction.
        bool with_errors;      //!< Plot error bars?
    
    Wuttke, Joachim's avatar
    ..  
    Wuttke, Joachim committed
        // For curve plotting:
    
        int equipoints;        //!< Start curve plot with this # grid points.
        bool refine;           //!< Refine curve plot when appropriate?
    
        CPlot( int _iPlot, bool _logx, bool _logy );
    
        void clear_frame();
        void plot_frame( const string& xlabel, const string& ylabel );
        void add_spec( bool as_line, bool new_style, int style_no,
    
                      const vector<double>& xp,
    
                      const vector<double>& yp,
                      const vector<double>& dyp,
    
                      const vector<string>& z,
    
                      const string& xco,
                      const string& yco,
                      const string& info );
    
        void show_specs();
        void doc_TxLine( const string& line );
        void doc_PtTxLine( const string& line, int num );
        void doc_CvTxLine( const string& line, int num );
        void write_postscript( const string& ps_outdir,
    
                              const string& ps_head,
                              const string& ps_dict );
    
        string info() const;
    
        // TODO: some of this could be made local static, if class instances
        // are created anew instead of calling clearFrame().
        int gp_fifo;      //!< Pipe to Gnuplot.
        int gp_fno;       //!< Number of Gnuplot input file.
        string gp_fnames; //!< List of currently plotted Gnuplot input file names.
    
        int ps_fnum;      //!< Postscript output file number.
        int ps_snum;      //!< Slice number in Postscript file.
        int ps_pnum;      //!< Spectrum number, for setting pstyle.
        int ps_cnum;      //!< Curve number, for setting cstyle.
    
        void ps_ticktack( const vector<double>& Tacks, int ntpt,
                          const double *ticklim, const CAxis *A );
    
        vector<string> ps_accu; //!< Main Postscript cache.
        vector<string> ps_Doc;  //!< Special Postscript cache for doc lines ?.