home *** CD-ROM | disk | FTP | other *** search
/ The Pier Shareware 6 / The_Pier_Shareware_Number_6_(The_Pier_Exchange)_(1995).iso / 035 / splot122.zip / DEMO / MANYSPEC.SPT < prev    next >
Text File  |  1994-07-11  |  2KB  |  94 lines

  1. #include <splot.h> 
  2. /* Created by Scott Wilson 02/05/93 */
  3. /* this splot file generates an xy 
  4.    plot of 5 data sets. Each curve  
  5.    has the same x scale and y scale 
  6.    but have been offset from each 
  7.    other in the y direction by an 
  8.    equal amount
  9. */
  10. /* define the data arrays */   
  11. double *pldata1, *pldata2, *pldata3, *pldata4, *pldata5;
  12. main()             
  13.   {                
  14.  
  15.    /* define a tic length  */
  16.    /* major and minor tics */
  17.            
  18.    double majortic,minortic;
  19.    majortic=0.25;  
  20.    minortic=0.17;  
  21.            
  22.    /* set up some default values */
  23.            
  24.    set(FONTASPECT,1.2);
  25.    set(FONTWIDTH,0.8);
  26.    set(LINECOLOUR,BLACK);
  27.    set(AXESCLIP,ON);
  28.    set(LINEWIDTH,0.09);
  29.    set(PLOTTYPE,LINES);
  30.  
  31.    /* load in the data */
  32.  
  33.    readdata("demo\4kc.dat",pldata1);
  34.    readdata("demo\15kc.dat",pldata2);
  35.    readdata("demo\35kc.dat",pldata3);
  36.    readdata("demo\45kc.dat",pldata4);
  37.    readdata("demo\60kc.dat",pldata5);
  38.  
  39.    /* define an axis box */
  40.  
  41.    axes_box(13,19,7650,-3000,7950,125000);
  42.            
  43.    /* set up some major tics*/ 
  44.  
  45.    set(TICKLENGTH,majortic);
  46.  
  47.    /* for the x-axis    */  
  48.  
  49.    tickmarks(XAXES,7700,7800,7900);
  50.  
  51.    /* for the y-axis    */  
  52.    /* note only denoting the zero point
  53.    for each curve */
  54.  
  55.    tickmarks(YAXES,0,5000,10000,15000,20000);
  56.  
  57.    /* set up some minor tics */                 
  58.  
  59.    set(LINEWIDTH,0.05);
  60.    set(TICKLENGTH,minortic);
  61.  
  62.    /* for the x axis */
  63.  
  64.    tickmarks(XAXES,7675,7725,7750,7775,7825,7850,7875,7925);
  65.  
  66.    /* place some ticklabels on the axes */
  67.  
  68.    ticklabel(BOTTOM);
  69.    ticklabel(RIGHT,0," 4K",5000,"15K",10000,"35K",15000,"45K",20000,"60K");
  70.  
  71.     /* place some labels on the axes */
  72.  
  73.    label(BOTTOM,"Photon Energy (cm^-1^)");
  74.    label(LEFT,"PL Intensity");             
  75.  
  76.    /* place some comments in the figure */
  77.  
  78.    text(3.98,21.11,"C_60_:^16^O_2_");
  79.    text(11.10,21.11,"!l!_ex_=710nm");
  80.  
  81.    /* put the data into the picture */
  82.  
  83.    drawdata(pldata1);
  84.      
  85.    set(YSHIFT,5000);
  86.    drawdata(pldata2);
  87.    set(YSHIFT,10000);
  88.    drawdata(pldata3);
  89.    set(YSHIFT,15000);
  90.    drawdata(pldata4);
  91.    set(YSHIFT,20000);
  92.    drawdata(pldata5);
  93.    }
  94.