home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / octa21fs.zip / octave / pnm / SImage / simage.m < prev    next >
Text File  |  2000-01-15  |  2KB  |  42 lines

  1. # written by Stefan Mueller stm@fgan.de 1996 
  2. function simage(x)
  3. # name of postscriptviewer
  4.   ghostview = "ghostview"; 
  5. # parameter
  6.   filename = "sImg";                     # name of eps-file
  7.   title = "ImageTitle";                  # title of eps-image
  8.   imagePosX = 55;                        # x-offset of image in inch/72
  9.   imagePosY = 200;                       # y-offset of image in inch/72
  10.   imageWidth = 400;                      # image width in inch/72
  11.   imageHeight = 400;                     # image height in inch/72
  12.   xStartValue = "0";                     # first value of x-axis
  13.   xEndValue = sprintf("%d",columns(x));  # last value of x-axis
  14.   yStartValue = "0";                     # first value of y-axis
  15.   yEndValue = sprintf("%d",rows(x));     # last value of y-axis
  16.   labelSouth="x-Label";                  # text below x-axis in south of image
  17.   labelWest = "y-Label";                 # text beside y-axis in west of image
  18.   labelNorth = "noLabel";                # text above x-axis in north of image
  19.   labelEast = "noLabel";                 # text beside y-axis in east of image
  20.   labelLegend = "legend";                # text beside legend 
  21. # legendType = "classify";               # classify legend
  22.   legendType = "linear";                 # linear legend
  23.   legendStartValue = "0.0";              # first value of legend
  24.   legendEndValue =sprintf("%d",rows(colormap));  #last value of legend
  25.  
  26. # make scaled image in eps format
  27.   eps_file = sprintf ("%s.eps",filename);
  28.   makesimage (x,
  29.               filename,imagePosX,imagePosY,
  30.               imageWidth,imageHeight,
  31.               xStartValue,xEndValue,
  32.               yStartValue,yEndValue,
  33.               legendStartValue,legendEndValue,
  34.               title,labelLegend,legendType,
  35.               labelWest,labelSouth,labelNorth,labelEast);
  36.  
  37. # Start the gsview
  38.   eps_file = sprintf ("%s.eps",filename);
  39.   gsview = sprintf ("(%s %s) &",ghostview,eps_file);
  40.   system(gsview);
  41. endfunction
  42.