src/GamIO/FrameMaker.cc
/* These function take a single row_vector and plot parameters then produce
   a FrameMaker MIF file containing the 1D plot, Re(i)/Im(i) vs i 

	Input 		out	: Output file stream (ASCII Frame MIF file)
			vx	: Input data vector to be plotted
			xsize	: Plot horizontal dimension in cm
			ysize	: Plot vertical dimension in cm
	  		pmax	: Plot vertical maximum (axis label)
	  		pmin	: Plot vertical minimum (axis label)
          		ri	: Flag for real versus imaginary plot
	  			    0=reals, non-zero=imaginaries

  Function                                Purpose
  --------	---------------------------------------------------------------
  FM_1D_ri      This is a auxiliary function to FM_1D that uses a PolyLine size 
                defaulting to 128 points (PLmax = 128)
*/
These function take a single row_vector and plot parameters then produce
a FrameMaker MIF file containing the 1D plot, Re(i)/Im(i) vs i



Function                                Purpose

FM_1D_ri      This is a auxiliary function to FM_1D that uses a PolyLine size
defaulting to 128 points (PLmax = 128)
These function take a single row_vector and plot parameters then produce a FrameMaker MIF file containing the 1D plot Re ( i ) / Im ( i ) vs i Function Purpose FM_1D_ri This is a auxiliary function to FM_1D that uses a PolyLine size defaulting to 128 points ( PLmax = 128 )
void FM_1D_ri(std::ostream &out, const row_vector &vx, double xsize,
                               double ysize, double pmin, double pmax, int ri)
  {
  int np = vx.elements();		
  if(np <= 1)				
    {
    FM_error(5);			
    FM_fatality(100);			
    }
  double ymin, ymax, ydel;		
  FM_maxima(vx, ymin, ymax, ri);	
  ydel = ymax-ymin;
  if(ydel == 0) ydel = ymax;
  if(ydel == 0) ydel = 1;
  double top, bottom, right, left;	
  FM_borders(xsize, ysize,
             top, bottom, right, left);
  double yscale =			
             (bottom-top)/(ymax-ymin);
  double xscale = (right-left)/(np-1);
  int FrameID = 11;			
  int PolyLineID = 1;
  if(ri)
    {
    FrameID++;
    PolyLineID = 2;
    }
  FM_AFrame_Set(out, xsize, ysize ,FrameID);	
  int PLmax = 128;				
  row_vector PL(PLmax+1);			
  double xcm, ycm, yin;
  xcm = left;				
  yin = ymax*yscale + top;
  if(ri)
    ycm = yin - vx.getIm(0)*yscale;
  else
    ycm = yin - vx.getRe(0)*yscale;
  int npl = 0;				
  int pts = 0;				
  int skip = 0;
  PL.put(complex(xcm, ycm), pts);
  for(int j=1; j<np; j++)		
    {					
    xcm += xscale;			
    if(ri)				
      ycm = yin - vx.getIm(j)*yscale;
    else				
      ycm = yin - vx.getRe(j)*yscale;
    if(pts == 0)			
      {
      pts++;				
      PL.put(complex(xcm, ycm), pts);
      skip = 0;
      }
    if(j == np-1)			
      {
      pts++;				
      if(skip)
        {
        PL.put(complex(xcm-xscale, Im(PL(pts-1))),pts);
        pts++;
        }
      PL.put(complex(xcm, ycm), pts);
      skip = 0;
      }
    else if((fabs(Im(PL(pts)) - ycm))	
                               >0.0001) 
      {
      pts++;
      if(skip)
        {
        PL.put(complex(xcm-xscale, Im(PL(pts-1))), pts);
        pts++;
        }
      PL.put(complex(xcm, ycm), pts);
      skip = 0;
      }
    else
      skip = 1;
    if(pts >= PLmax-1)			
      {
      FM_PolyLine(out, PL, PolyLineID, 15, pts+1, 0);
      npl++;
      PL.put(PL(pts), 0);
      pts = 0;
      skip = 0;
      }
    }
  if(pts >= 1)				
    {
    FM_PolyLine(out,PL,PolyLineID,15,pts+1,0);
    npl++;
    }
  if (npl>1)				
    FM_Group (out, PolyLineID);
  FM_Axis (out, 'x', bottom, left, right, pmin, pmax);
  FM_Axis (out, 'y', left, bottom, top, ymin, ymax);
  FM_AFrame_End (out);			
  }
void FM_1D_ri ( std :: ostream & out , const row_vector & vx , double xsize , double ysize , double pmin , double pmax , int ri ) { int np = vx . elements ( ) ; if ( np <= 1 ) { FM_error ( 5 ) ; FM_fatality ( 100 ) ; } double ymin , ymax , ydel ; FM_maxima ( vx , ymin , ymax , ri ) ; ydel = ymax - ymin ; if ( ydel == 0 ) ydel = ymax ; if ( ydel == 0 ) ydel = 1 ; double top , bottom , right , left ; FM_borders ( xsize , ysize , top , bottom , right , left ) ; double yscale = ( bottom - top ) / ( ymax - ymin ) ; double xscale = ( right - left ) / ( np - 1 ) ; int FrameID = 11 ; int PolyLineID = 1 ; if ( ri ) { FrameID ++ ; PolyLineID = 2 ; } FM_AFrame_Set ( out , xsize , ysize , FrameID ) ; int PLmax = 128 ; row_vector PL ( PLmax + 1 ) ; double xcm , ycm , yin ; xcm = left ; yin = ymax * yscale + top ; if ( ri ) ycm = yin - vx . getIm ( 0 ) * yscale ; else ycm = yin - vx . getRe ( 0 ) * yscale ; int npl = 0 ; int pts = 0 ; int skip = 0 ; PL . put ( complex ( xcm , ycm ) , pts ) ; for ( int j = 1 ; j < np ; j ++ ) { xcm += xscale ; if ( ri ) ycm = yin - vx . getIm ( j ) * yscale ; else ycm = yin - vx . getRe ( j ) * yscale ; if ( pts == 0 ) { pts ++ ; PL . put ( complex ( xcm , ycm ) , pts ) ; skip = 0 ; } if ( j == np - 1 ) { pts ++ ; if ( skip ) { PL . put ( complex ( xcm - xscale , Im ( PL ( pts - 1 ) ) ) , pts ) ; pts ++ ; } PL . put ( complex ( xcm , ycm ) , pts ) ; skip = 0 ; } else if ( ( fabs ( Im ( PL ( pts ) ) - ycm ) ) > 0.0001 ) { pts ++ ; if ( skip ) { PL . put ( complex ( xcm - xscale , Im ( PL ( pts - 1 ) ) ) , pts ) ; pts ++ ; } PL . put ( complex ( xcm , ycm ) , pts ) ; skip = 0 ; } else skip = 1 ; if ( pts >= PLmax - 1 ) { FM_PolyLine ( out , PL , PolyLineID , 15 , pts + 1 , 0 ) ; npl ++ ; PL . put ( PL ( pts ) , 0 ) ; pts = 0 ; skip = 0 ; } } if ( pts >= 1 ) { FM_PolyLine ( out , PL , PolyLineID , 15 , pts + 1 , 0 ) ; npl ++ ; } if ( npl > 1 ) FM_Group ( out , PolyLineID ) ; FM_Axis ( out , ' ' , bottom , left , right , pmin , pmax ) ; FM_Axis ( out , ' ' , left , bottom , top , ymin , ymax ) ; FM_AFrame_End ( out ) ; }
These function take a single row_vector and plot parameters then produce
a FrameMaker MIF file containing the 1D plot, Re(i)/Im(i) vs i
These function take a single row_vector and plot parameters then produce a FrameMaker MIF file containing the 1D plot Re ( i ) / Im ( i ) vs i
// Total points // Must have more than 1 point // Error from vector of 0 or 1 pt.  // Fatal error flagged in 1D plot // Begin scaling // Get vertical maxima // Declare and set margins // Scaling in x and y directions // Set Frame and Polyline ID numbers // Write Frame header // Begin plotting data // Limit size of Polyline(s) // Vector for Polyline 128+1 pt(max.) // Initial point, 1st Polyline // Polyline count // Polyline point count (-1) // Go through each point, get // coordinates in cm // x(j) = j*xscale+left // Treat Imaginaries // Treat Reals // Add pt if 2nd in Polyline // Add pt if last in Polyline // or last in data vector // Add pt if height changes // (sets vertical resolution!) // Limit Polyline length to PLmax // Output Polyline if end // Group all Polylines // End of Frame