src/GamIO/FrameMaker.cc
/*************************************************************************
**									**
** 		           FrameMaker Scatter Plots			**
**									**
** Author	: SOSI 							**
** Description  : Takes a vector from input along with plot parameters	**
**		  and produces a FrameMaker file containing a scatter 	**
**		  plot of the vector.					**
**									**
*************************************************************************/


Author : SOSI
Description  : Takes a vector from input along with plot parameters
and produces a FrameMaker file containing a scatter
plot of the vector.
Author : SOSI Description : Takes a vector from input along with plot parameters and produces a FrameMaker file containing a scatter plot of the vector .
void FM_scatter(const std::string& fout,row_vector &vx,char z,double xsz,double ysz)
  {
  if((xsz < 5)||(xsz > 20)) xsz = 14;		
  if((ysz < 5)||(ysz > 27)) ysz = 14;
  double ymin, ymax, xmax, xmin;		
  FM_maxima(vx, ymin, ymax, 1);			
  FM_maxima(vx, xmin, xmax, 0);			
  double top, bottom, right, left;		
  FM_borders(xsz,ysz,top,bottom,right,left);	
  double yscale = (top-bottom)/(ymax-ymin); 	
  double xscale = (right-left)/(xmax-xmin); 	
  std::ofstream out(fout.c_str());			
  FM_Begin(out);				
  FM_AFrames_Begin(out);			
  FM_AFrame_Set (out, xsz, ysz);		
  int np = vx.elements(); 			
  double x, y;					
  for(int i=0; i<np; i++)			
    {
    x = (vx.getRe(i)-xmin)*xscale+left;		
    y = (vx.getIm(i)-ymin)*yscale+bottom;	
    FM_TextLine(out, 72, x, y, z);		
    }
  FM_Axis (out,'x',bottom,left,right,xmin,xmax);
  FM_Axis (out,'y',left,bottom,top,ymin,ymax);	
  FM_Group(out, 72, 73);			
  FM_AFrame_End(out);				
  FM_AFrames_End(out);				
  FM_ParaText_End(out);				
  FM_End(out);					
  }
void FM_scatter ( const std :: string & fout , row_vector & vx , char z , double xsz , double ysz ) { if ( ( xsz < 5 ) || ( xsz > 20 ) ) xsz = 14 ; if ( ( ysz < 5 ) || ( ysz > 27 ) ) ysz = 14 ; double ymin , ymax , xmax , xmin ; FM_maxima ( vx , ymin , ymax , 1 ) ; FM_maxima ( vx , xmin , xmax , 0 ) ; double top , bottom , right , left ; FM_borders ( xsz , ysz , top , bottom , right , left ) ; double yscale = ( top - bottom ) / ( ymax - ymin ) ; double xscale = ( right - left ) / ( xmax - xmin ) ; std :: ofstream out ( fout . c_str ( ) ) ; FM_Begin ( out ) ; FM_AFrames_Begin ( out ) ; FM_AFrame_Set ( out , xsz , ysz ) ; int np = vx . elements ( ) ; double x , y ; for ( int i = 0 ; i < np ; i ++ ) { x = ( vx . getRe ( i ) - xmin ) * xscale + left ; y = ( vx . getIm ( i ) - ymin ) * yscale + bottom ; FM_TextLine ( out , 72 , x , y , z ) ; } FM_Axis ( out , ' ' , bottom , left , right , xmin , xmax ) ; FM_Axis ( out , ' ' , left , bottom , top , ymin , ymax ) ; FM_Group ( out , 72 , 73 ) ; FM_AFrame_End ( out ) ; FM_AFrames_End ( out ) ; FM_ParaText_End ( out ) ; FM_End ( out ) ; }
FrameMaker Scatter Plots
FrameMaker Scatter Plots
// Input	fout	: FrameMaker mif file name // 		vx      : Data vector containing points //		z	: Character to use to mark points // 		xsz 	: Horizontal plot size in cm. // 		ysz	: Vertical plot size in cm. // Return		: Void, FrameMaker plot file output // Insure plot sizes sensible // Calculate maxima and minima // Get vertical maxima // Get horizontal maxima // Declare and set margins // Set plot borders // Compute scaling factors // Begin FrameMaker Plot // Open file // FrameMaker begin comment // Anchored Frame begin // Header of Frame // Get total points plotted // For point x,y coordinates // Loop over all points //   Point x coordinate //   Point y coordinate //   Draw symbol z at point // Output x axis // Output y axis // Group all points together // Tail of Frame // Anchored Frame end // End Frame TextFlow // FrameMaker End