Skip to content
Snippets Groups Projects
dualplot.hpp 2.9 KiB
Newer Older
//**************************************************************************************************
//*  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 );
Wuttke, Joachim's avatar
Wuttke, Joachim committed
    void gp_write( const std::string& in );
Wuttke, Joachim's avatar
Wuttke, Joachim committed
    void plot_frame( const std::string& xlabel, const std::string& ylabel );
    void add_spec( bool as_line, bool new_style, int style_no,
Wuttke, Joachim's avatar
Wuttke, Joachim committed
                  const std::vector<double>& xp,
                  const std::vector<double>& yp,
                  const std::vector<double>& dyp,
                  const std::vector<std::string>& z,
                  const std::string& xco,
                  const std::string& yco,
                  const std::string& info );
Wuttke, Joachim's avatar
Wuttke, Joachim committed
    void doc_TxLine( const std::string& line );
    void doc_PtTxLine( const std::string& line, int num );
    void doc_CvTxLine( const std::string& line, int num );
    void write_postscript( const std::string& ps_outdir,
                          const std::string& ps_head,
                          const std::string& ps_dict );
    void set_aux( const std::string& cmd );
    std::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.
Wuttke, Joachim's avatar
Wuttke, Joachim committed
    std::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.
Wuttke, Joachim's avatar
Wuttke, Joachim committed
    void ps_ticktack( const std::vector<double>& Tacks, int ntpt,
                      const double *ticklim, const CAxis *A );
Wuttke, Joachim's avatar
Wuttke, Joachim committed
    std::vector<std::string> ps_accu; //!< Main Postscript cache.
    std::vector<std::string> ps_Doc;  //!< Special Postscript cache for doc lines ?.