home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / octa21eb.zip / octave / SCRIPTS.ZIP / scripts.fat / plot / _pltopt_.m < prev    next >
Text File  |  1999-04-29  |  3KB  |  84 lines

  1. ## Copyright (C) 1996, 1997 John W. Eaton
  2. ##
  3. ## This file is part of Octave.
  4. ##
  5. ## Octave is free software; you can redistribute it and/or modify it
  6. ## under the terms of the GNU General Public License as published by
  7. ## the Free Software Foundation; either version 2, or (at your option)
  8. ## any later version.
  9. ##
  10. ## Octave is distributed in the hope that it will be useful, but
  11. ## WITHOUT ANY WARRANTY; without even the implied warranty of
  12. ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  13. ## General Public License for more details.
  14. ##
  15. ## You should have received a copy of the GNU General Public License
  16. ## along with Octave; see the file COPYING.  If not, write to the Free
  17. ## Software Foundation, 59 Temple Place - Suite 330, Boston, MA
  18. ## 02111-1307, USA.
  19.  
  20. ## usage: fmt = _pltopt_ (caller, opt)
  21. ##
  22. ## Decode plot option strings.
  23. ##
  24. ## If OPT is a valid option string, return a string of the form "w l 2"
  25. ## ("with lines 2").  Uses abbreviations for the options to avoid
  26. ## overrunning gnuplot's command line buffer unnecessarily.
  27. ##
  28. ## OPT can currently be some combination of the following:
  29. ##
  30. ##   "-"   for lines plot style (default).
  31. ##   "."   for dots plot style.
  32. ##   "@"   for points plot style.
  33. ##   "-@"  for linespoints plot style.
  34. ##   "^"   for impulses plot style.
  35. ##   "L"   for steps plot style.
  36. ##   "#"   for boxes plot style.
  37. ##   "~"   for errorbars plot style.
  38. ##   "#~"  for boxerrorbars plot style.
  39. ##   "n"   with n in 1-6 (wraps at 8), plot color
  40. ##   "nm"  with m in 1-6 (wraps at 6), point style (only valid for "@" or "-@")
  41. ##   "c"   where c is one of ["r", "g", "b", "m", "c", "w"] colors.
  42. ##   ";title;" where "title" is the label for the key.
  43. ##
  44. ##   Special points formats:
  45. ##
  46. ##      "+", "*", "o", "x" will display points in that style for term x11.
  47. ##
  48. ##   The legend may be fixed to include the name of the variable
  49. ##   plotted in some future version of Octave.
  50. ##
  51. ##   The colors, line styles, and point styles have the following
  52. ##   meanings for X11 and Postscript terminals under Gnuplot 3.6.
  53. ##
  54. ##   Number ------ Color -------  Line Style      ---- Points Style ----   
  55. ##          x11       postscript  postscript      x11         postscript   
  56. ##   =====================================================================
  57. ##     1    red       green       solid           "o"         "+"         
  58. ##     2    green     blue        long dash       "+"         "x"         
  59. ##     3    blue      red         short dash     square       "*"         
  60. ##     4    magenta   magenta     dotted          "x"        open square  
  61. ##     5    cyan      cyan        dot long dash  triangle    filled square
  62. ##     6    brown     yellow      dot short dash  "*"         "o"         
  63. ##
  64. ## See also: _pltopt1
  65.  
  66. ## Author: jwe
  67. ## Adapted-By: jwe
  68. ## Maintainer: jwe
  69.  
  70. function fmt = _pltopt_ (caller, opt)
  71.  
  72.   if (! isstr (opt))
  73.     usage ("_pltopt_ (caller, opt)");
  74.   endif
  75.  
  76.   nr = rows (opt);
  77.   fmt = "";
  78.   for i = 1:nr
  79.     t = _pltopt1 (caller, deblank (opt(i,:)));
  80.     fmt(i,1:length(t)) = t;
  81.   endfor
  82.  
  83. endfunction
  84.