home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / octa21eb.zip / octave / SCRIPTS.ZIP / scripts.fat / plot / plot.m < prev    next >
Text File  |  1999-04-29  |  3KB  |  78 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: plot (x, y)
  21. ##        plot (x1, y1, x2, y2, ...)
  22. ##        plot (x, y, fmt)
  23. ##
  24. ## If the first argument is a vector and the second is a matrix, the
  25. ## the vector is plotted versus the columns (or rows) of the matrix.
  26. ## (using whichever combination matches, with columns tried first.)
  27. ##
  28. ## If the first argument is a matrix and the second is a vector, the
  29. ## the columns (or rows) of the matrix are plotted versus the vector.
  30. ## (using whichever combination matches, with columns tried first.)
  31. ##
  32. ## If both arguments are vectors, the elements of y are plotted versus
  33. ## the elements of x.
  34. ##
  35. ## If both arguments are matrices, the columns of y are plotted versus
  36. ## the columns of x.  In this case, both matrices must have the same
  37. ## number of rows and columns and no attempt is made to transpose the
  38. ## arguments to make the number of rows match.
  39. ##
  40. ## If both arguments are scalars, a single point is plotted.
  41. ##
  42. ## If only one argument is given, it is taken as the set of y
  43. ## coordinates and the x coordinates are taken to be the indices of the
  44. ## elements, starting with 1.
  45. ##
  46. ## To see possible options for FMT please see _pltopt_.
  47. ##
  48. ## Examples:
  49. ##
  50. ##   plot (x, y, "@12", x, y2, x, y3, "4", x, y4, "+")
  51. ##
  52. ##     y will be plotted with points of type 2 ("+") and color 1 (red).
  53. ##     y2 will be plotted with lines.
  54. ##     y3 will be plotted with lines of color 4.
  55. ##     y4 will be plotted with points which are "+"s.
  56. ##
  57. ##   plot (b, "*")
  58. ##
  59. ##     b will be plotted with points of type "*".
  60. ##
  61. ## See also: semilogx, semilogy, loglog, polar, mesh, contour, _pltopt_
  62. ##           bar, stairs, gplot, gsplot, replot, xlabel, ylabel, title
  63.  
  64. ## Author: jwe
  65.  
  66. function plot (...)
  67.  
  68.   ## XXX FIXME XXX -- these plot states should really just be set
  69.   ## temporarily, probably inside an unwind_protect block, but there is
  70.   ## no way to determine their current values.
  71.  
  72.   gset nologscale;
  73.   gset nopolar;
  74.  
  75.   __plt__ ("plot", all_va_args);
  76.  
  77. endfunction
  78.