X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?p=CreaPhase.git;a=blobdiff_plain;f=octave_packages%2Fplot-1.1.0%2Ftics.m;fp=octave_packages%2Fplot-1.1.0%2Ftics.m;h=e2357e9b3b11d8e4f0e51a67f54520348c880d44;hp=0000000000000000000000000000000000000000;hb=c880e8788dfc484bf23ce13fa2787f2c6bca4863;hpb=1705066eceaaea976f010f669ce8e972f3734b05 diff --git a/octave_packages/plot-1.1.0/tics.m b/octave_packages/plot-1.1.0/tics.m new file mode 100644 index 0000000..e2357e9 --- /dev/null +++ b/octave_packages/plot-1.1.0/tics.m @@ -0,0 +1,48 @@ +## Copyright (C) 2002 Paul Kienzle +## Copyright (C) 2005 Dmitri A. Sergatskov +## Copyright (C) 2007 Russel Valentine +## Copyright (C) 2007 Peter Gustafson +## This program is in the public domain + +## -*- texinfo -*- +## @deftypefn {Function File} {} tics (@var{axis}, [@var{pos1}, @var{pos2}, @dots{}], [@var{lab1}, @var{lab2}, @dots{}],) +## Explicitly set the tic positions and labels for the given axis. +## +## @var{axis} must be 'x', 'y' or 'z'. +## +## If no positions or labels are given, then restore the default. +## If positions are given but no labels, use those positions with the +## normal labels. If positions and labels are given, each position +## labeled with the corresponding row from the label matrix. +## +## @end deftypefn + +function tics (axis, pos, lab) + + if ( nargin < 1 || nargin > 3 ) + print_usage; + endif + + t = lower (axis); + if (t ~= "x" && t ~= "y" && t ~= "z") + error ("First input argument must be one of 'x', 'y' or 'z'"); + endif + + if (nargin == 1) + set (gca(), [t, "tick"], []); + set (gca(), [t, "tickmode"], "auto"); + set (gca(), [t, "ticklabel"], ""); + set (gca(), [t, "ticklabelmode"], "auto"); + elseif (nargin == 2) + set (gca(), [t, "tick"], pos); + set (gca(), [t, "ticklabel"], ""); + set (gca(), [t, "ticklabelmode"], "auto"); + elseif (nargin == 3) + set (gca(), [t, "tick"], pos); + set (gca(), [t, "ticklabel"], lab); + else + ## we should never get here anyway + print_usage; + endif + +endfunction