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 / LOGAXES.SPT < prev    next >
Text File  |  1994-07-11  |  2KB  |  93 lines

  1. /* This figure demonstrates how to use axes other */
  2. /* than the standard linear axes. Also it illustrates */
  3. /* how insets can be made. Insets alternatively can */
  4. /* be made by encapsulating an entire drawing in a */
  5. /* subroutine. */
  6.  
  7. #include <splot.h>
  8.                            
  9. double *lifetime, *rawtime;          
  10.  
  11. main()           
  12.    {             
  13.    int i;
  14.    double majortic,minortic;
  15.  
  16.    /* define a tic length  */
  17.    /* major and minor tics */
  18.  
  19.    majortic=0.3;
  20.    minortic=0.25;
  21.  
  22.    /* set up some default values */
  23.  
  24.    set(FONTASPECT,1.2);
  25.    set(FONTWIDTH,0.8);
  26.    set(PLOTTYPE,SYM_LINES);
  27.    set(CURSYMBOL,CIRCLE);
  28.    set(AXESCLIP,ON);
  29.    set(LINEWIDTH,0.1);
  30.    set(AXESTYPE,LOGY);
  31.  
  32.    /* get the data and set the box  */                
  33.   
  34.    readdata("demo\lifetime.dat",lifetime);
  35.    /* draw axes box but not centered on the page */
  36.    axes_box(13,17,-30,0.9,330,60,5.51,7.5);
  37.   
  38.    /* x-axis   */  
  39.   
  40.    /* major tics*/
  41.   
  42.    set(TICKLENGTH,majortic);
  43.    tickmarks(XAXES,0,100,200,300);
  44.   
  45.    /* minor ticks */
  46.   
  47.    set(TICKLENGTH,minortic);
  48.    set(LINEWIDTH,0.05);
  49.    tickmarks(XAXES,25,50,75,125,150,175,225,250,275);
  50.    ticklabel(BOTTOM,0,"0",100,"100",200,"200",300,"300");
  51.   
  52.    /* y-axis */
  53.   
  54.    /* major tics*/
  55.   
  56.    set(TICKLENGTH,majortic);
  57.    set(LINEWIDTH,0.1);
  58.    tickmarks(YAXES,1,10,50);
  59.   
  60.    /* minor ticks */
  61.   
  62.    set(TICKLENGTH,minortic);
  63.    set(LINEWIDTH,0.05);
  64.    tickmarks(YAXES,2,3,4,5,6,7,8,9,20,30,40);
  65.    ticklabel(LEFT,1,10,50);
  66.   
  67.    /* axis labels */
  68.   
  69.    label(LOWER,"Temperature (K)");
  70.    label(LEFT,"Lifetime (ms)");
  71.   
  72.    drawdata(lifetime,0,1);        
  73.  
  74.    /* now build the inset figure */
  75.    /* insert  setup stuff */ 
  76.    set(PLOTTYPE,LINES);
  77.    set(LINEWIDTH,0.065);
  78.    set(AXESTYPE,LOGY);
  79.    readdata("demo\rawtime.dat",rawtime);
  80.    axes_box(6,7.85,0.00,20,0.400,250000,8.02,10.19);
  81.    set(LINEWIDTH,0.05);
  82.    tickmarks(XAXES,0.1);
  83.    tickmarks(YAXES,1);
  84.    set(FONTASPECT,1.0);
  85.    set(FONTWIDTH,0.67);
  86.    ticklabel(BOTTOM,0,0.4);
  87.    drawdata(rawtime,0,1);        
  88.    text(11.30,16.64,"T=20K");
  89.    label(LEFT,"Log Counts (Decades)");
  90.    set(LABELMARG,-0.8);
  91.    label(BOTTOM,"time (ms)");
  92.    }                          
  93.