Mercurial > forge
changeset 3271:1515537b4164 octave-forge
Fixes to use new graphic handles
author | adb014 |
---|---|
date | Fri, 23 Mar 2007 20:45:21 +0000 |
parents | a34457658a11 |
children | 17e102866239 |
files | main/irsa/inst/irsa_act.m main/irsa/inst/irsa_dft.m main/irsa/inst/irsa_jitsp.m main/irsa/inst/irsa_mdsp.m main/irsa/inst/irsa_plotdft.m main/irsa/inst/irsa_rgenreal.m main/plot/inst/dhbar.m main/plot/inst/fill.m main/plot/inst/gget.m main/plot/inst/ginput.m main/plot/inst/meshc.m main/plot/inst/patch.m main/plot/inst/peaks.m main/plot/inst/pie.m main/plot/inst/quiver.m main/plot/inst/tics.m |
diffstat | 16 files changed, 139 insertions(+), 161 deletions(-) [+] |
line wrap: on
line diff
--- a/main/irsa/inst/irsa_act.m Fri Mar 23 20:31:14 2007 +0000 +++ b/main/irsa/inst/irsa_act.m Fri Mar 23 20:45:21 2007 +0000 @@ -113,8 +113,9 @@ %! xplong = linspace( 0, N-(1/ofac), N*ofac )'*Tmean + xp1; %! yplong = irsa_idft( fxp, fyp, xplong, true )*ofac; %! titlestr = sprintf( "Jittered sampling of a band-limited signal (fmax=%g) with mean spacing %g and jitter %g ", fmax, Tmean, jit ); -%! title( titlestr ); xlabel( "time" ); ylabel( "value" ); __gnuplot_set__ nokey; %! plot( xplong, yplong,'-1', xp, yp, '^3', xp, yp, '@*3' ); title(""); +%! title( titlestr ); xlabel( "time" ); ylabel( "value" ); legend('off'); +%! hold on; %! [rxp,ryp] = irsa_act( xp, yp, fmax, N ); %! input( "Press Enter to see the reconstruction" ); %! title( "Reconstruction" );
--- a/main/irsa/inst/irsa_dft.m Fri Mar 23 20:31:14 2007 +0000 +++ b/main/irsa/inst/irsa_dft.m Fri Mar 23 20:45:21 2007 +0000 @@ -78,24 +78,24 @@ %! eqfyp = irsa_dft( eqxp, yp, eqfxp ); %! [eqfxp,idx] = sort( eqfxp ); eqfyp = eqfyp(idx); %! ## Plot -%! __gnuplot_set__ yrange [0:1.2]; __gnuplot_set__ xrange [-2.5:2.5] __gnuplot_set__ nokey +%! figure(); %! subplot( 211 ) +%! plot( eqfxp, abs(eqfyp)/N, '-b' ); text(); %! title( "|DFT| of regular timeseries of ones (with spacing 1 and therefore a Nyquist frequency of 0.5)" ); %! text( -1.5, 1.1, "The usual comb" ); -%! plot( eqfxp, abs(eqfyp)/N, '-3' ); text(); +%! axis([-2.5,2.5,0,1.2]); +%! legend('off'); %! mdfxp = irsa_dftfp( mdxp, hifac, ofac ); %! mdfyp = irsa_dft( mdxp, yp, mdfxp ); %! [mdfxp,idx] = sort( mdfxp ); mdfyp = mdfyp(idx); %! subplot( 212 ) +%! plot( mdfxp, abs(mdfyp)/N, '-r' ); text(); %! title( "|DFT| of irregular timeseries of ones (minimum distance sampling with md = 0.8 and random part = 0.2)" ); -%! text( -1.5, 1.1, "The irregularity destroyes the comb" ); +%! text( -1.5, 1.1, "The irregularity destroys the comb" ); %! text( -0.5,0.3,"blue noise"); text( 0.1,0.3,"blue noise" ); %! xlabel( "Frequency" ); -%! plot( mdfxp, abs(mdfyp)/N, '-1' ); text(); -%! oneplot(); -%! ## Clean -%! __gnuplot_set__ autoscale; __gnuplot_set__ key -%! xlabel(""); title(""); +%! axis([-2.5,2.5,0,1.2]); +%! legend('off'); ### Local Variables: ### mode: octave
--- a/main/irsa/inst/irsa_jitsp.m Fri Mar 23 20:31:14 2007 +0000 +++ b/main/irsa/inst/irsa_jitsp.m Fri Mar 23 20:45:21 2007 +0000 @@ -109,26 +109,17 @@ %! jitxp = irsa_jitsp( 1 , N, 1 ) + 1; %! o = ones(N,1); %! ## Plot -%! __gnuplot_set__ nokey -%! __gnuplot_set__ xrange [0:13] -%! __gnuplot_set__ yrange [0:1.5] -%! __gnuplot_set__ xtics 1 -%! __gnuplot_set__ mxtics 2 -%! __gnuplot_set__ grid mxtics -%! __gnuplot_set__ noytics +%! figure(); +%! legend('off'); +%! axis([0,13,0,1.5]); %! subplot( 211 ); +%! plot( eqxp, o, '^b', eqxp, o, '*b' ); text(); title(""); %! title( "Jittered Sampling versus regular (equidistant) sampling" ); %! text( 2,1.25, 'regular sampling with distance = 1' ); -%! plot( eqxp, o, '^3', eqxp, o, '@*3' ); text(); title(""); %! subplot( 212 ); +%! plot( jitxp, o, '^r', jitxp, o, 'xr' ); text; %! xlabel( "Time" ); %! text( 2,1.25, 'jittered sampling with mean distance = 1 and i.i.d. jitter within a range of 1' ); -%! plot( jitxp, o, '^1', jitxp, o, '@x1' ); text; -%! oneplot(); -%! ## Clean up gnuplot -%! __gnuplot_set__ key; __gnuplot_set__ autoscale; __gnuplot_set__ xtics autofreq; __gnuplot_set__ ytics autofreq; -%! __gnuplot_set__ nox2tics; __gnuplot_set__ nogrid; __gnuplot_set__ nomxtics; -%! xlabel(""); title(""); ylabel(""); ### Local Variables: ### mode: octave
--- a/main/irsa/inst/irsa_mdsp.m Fri Mar 23 20:31:14 2007 +0000 +++ b/main/irsa/inst/irsa_mdsp.m Fri Mar 23 20:45:21 2007 +0000 @@ -71,26 +71,19 @@ %! mdxp = irsa_mdsp( .2 , .8, N, "randn" ); %! o = ones(N,1); %! ## Plot -%! __gnuplot_set__ nokey -%! ## __gnuplot_set__ xrange [-0.5:19.5] -%! __gnuplot_set__ yrange [0:1.5] -%! # __gnuplot_set__ xtics 2 -%! __gnuplot_set__ noytics +%! figure(); %! subplot( 211 ); +%! plot( eqxp, o, '^b', eqxp, o, '*b' ); text(); title(""); %! title( "Irregular Minimum Distance Sampling versus regular (equidistant) sampling" ); +%! legend('off'); +%! axis ([-0.5,19.5,0,1.5]); %! text( 5,1.25, 'regular sampling with distance = 1' ); -%! plot( eqxp, o, '^3', eqxp, o, '@*3' ); text(); title(""); %! subplot( 212 ); +%! plot( mdxp, o, '^r', mdxp, o, 'xr' ); text; %! xlabel( "Time" ); %! text( 5,1.25, 'minimum distance sampling with md = 0.2 and rd = 0.8' ); -%! plot( mdxp, o, '^1', mdxp, o, '@x1' ); text; -%! oneplot(); -%! ## Clean up gnuplot -%! __gnuplot_set__ key -%! __gnuplot_set__ autoscale -%! __gnuplot_set__ xtics autofreq -%! __gnuplot_set__ ytics autofreq -%! xlabel(""); +%! legend('off'); +%! axis ([-0.5,19.5,0,1.5]); ### Local Variables: ### mode: octave
--- a/main/irsa/inst/irsa_plotdft.m Fri Mar 23 20:31:14 2007 +0000 +++ b/main/irsa/inst/irsa_plotdft.m Fri Mar 23 20:45:21 2007 +0000 @@ -36,20 +36,15 @@ if( nargout > 0 ) # Exit function return; else # Plot - __gnuplot_set__ nokey; + subplot(2,1,1); + plot( fxps, abs( fyps ) ); title(""); + legend('off'); title( "Spectrum represented in amplitudes and phases" ); - subplot(2,1,1); ylabel( "Amplitude" ) - plot( fxps, abs( fyps ) ); title(""); subplot(2,1,2); + plot( fxps, arg( fyps )/(2*pi) ); xlabel( "Frequency" ); ylabel( "Phase [rad/(2*pi)]" ); - ## __gnuplot_set__ yrange [-0.5:0.5]; - __gnuplot_set__ ytics 0.25 - plot( fxps, arg( fyps )/(2*pi) ); - ## Clean up gnuplot - oneplot(); title(""); xlabel(""); ylabel(""); - __gnuplot_set__ ytics autofreq; __gnuplot_set__ key; __gnuplot_set__ autoscale; __gnuplot_set__ nogrid; endif endfunction
--- a/main/irsa/inst/irsa_rgenreal.m Fri Mar 23 20:31:14 2007 +0000 +++ b/main/irsa/inst/irsa_rgenreal.m Fri Mar 23 20:45:21 2007 +0000 @@ -113,12 +113,13 @@ %! longxp = linspace( 0, N-(1/16), N*16 ) + xp1; %! [yp, fxp, fyp] = irsa_rgenreal( xp, 1/8 ); %! longyp = irsa_idft( fxp, fyp, longxp, true )*16; +%! figure(); +%! plot( longxp, longyp, '-r', xp, yp, '*b' ); %! title( sprintf"Regular timeseries with spacing 1 and fmax = 1/8" ); %! xlabel( "Sampling points" ); %! ylabel( "Sampling values" ); -%! __gnuplot_set__ nokey; -%! plot( longxp, longyp, '-', xp, yp, '@*3' ); -%! title(""); xlabel(""); ylabel(""); __gnuplot_set__ key; +%! legend('off'); +%! hold on; %! input("Press Enter to see the spectrum up to the band-limit"); %! irsa_plotdft( fxp, fyp ); %! input("Press Enter to see the whole spectrum computed via FFT"); @@ -130,18 +131,20 @@ %! longxp = linspace( 0, N-(1/ofac), N*ofac ) + xp1; %! [yp, fxp, fyp] = irsa_rgenreal( xp, 1/8 ); %! longyp = irsa_idft( fxp, fyp, longxp, true )*16; +%! figure(); +%! plot( longxp, longyp, '-r', xp, yp, '*b' ); %! title( "Irregular timeseries with mean spacing 1 and fmax = 1/8" ); %! xlabel( "Sampling points" ); %! ylabel( "Sampling values" ); -%! __gnuplot_set__ nokey; -%! plot( longxp, longyp, '-', xp, yp, '@*3' ); -%! title(""); xlabel(""); ylabel(""); __gnuplot_set__ key; +%! legend('off'); +%! hold on; %! input("Press Enter to see the spectrum up to the band-limit"); %! irsa_plotdft( fxp, fyp ); %! input("Press Enter to see the spectrum via DFT"); %! fxp = irsa_dftfp( xp ); %! fyp = irsa_dft( xp, yp, fxp ); %! irsa_plotdft( fxp, fyp ); + ### Local Variables: ### mode: octave ### End:
--- a/main/plot/inst/dhbar.m Fri Mar 23 20:31:14 2007 +0000 +++ b/main/plot/inst/dhbar.m Fri Mar 23 20:45:21 2007 +0000 @@ -7,7 +7,7 @@ ## ## You should have received a copy of the GNU General Public License ## along with this file; see the file COPYING. If not, write to the -## Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA +## Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA ## 02110-1301, USA. ## BAR create Bar graph
--- a/main/plot/inst/fill.m Fri Mar 23 20:31:14 2007 +0000 +++ b/main/plot/inst/fill.m Fri Mar 23 20:45:21 2007 +0000 @@ -7,7 +7,7 @@ ## ## You should have received a copy of the GNU General Public License ## along with this file; see the file COPYING. If not, write to the -## Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA +## Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA ## 02110-1301, USA. ## FILL creates a pseudo-shaded patch @@ -29,7 +29,8 @@ usage("fill (x,y,c)"); end - c=[c(1),';;']; + col = 'rgbcmy'; + c=[col(c(1)),';;']; xs=size(x); ys=size(y); @@ -66,7 +67,7 @@ hold on; end unwind_protect_cleanup - if (!held) hold off; end; + if (!held), hold off; end; end_unwind_protect end
--- a/main/plot/inst/gget.m Fri Mar 23 20:31:14 2007 +0000 +++ b/main/plot/inst/gget.m Fri Mar 23 20:45:21 2007 +0000 @@ -7,7 +7,7 @@ ## ## You should have received a copy of the GNU General Public License ## along with this file; see the file COPYING. If not, write to the -## Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA +## Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA ## 02110-1301, USA. ## usage: m = gget(option)
--- a/main/plot/inst/ginput.m Fri Mar 23 20:31:14 2007 +0000 +++ b/main/plot/inst/ginput.m Fri Mar 23 20:45:21 2007 +0000 @@ -7,7 +7,7 @@ ## ## You should have received a copy of the GNU General Public License ## along with this file; see the file COPYING. If not, write to the -## Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA +## Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA ## 02110-1301, USA. ## [...] = ginput (...)
--- a/main/plot/inst/meshc.m Fri Mar 23 20:31:14 2007 +0000 +++ b/main/plot/inst/meshc.m Fri Mar 23 20:45:21 2007 +0000 @@ -12,20 +12,20 @@ ## ## You should have received a copy of the GNU General Public License ## along with this program; see the file COPYING. If not, write to the -## Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA +## Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA ## 02110-1301, USA. ## -*- texinfo -*- ## @deftypefn {Function File} {} meshc (@var{x}, @var{y}, @var{z}) -## Plot a mesh given matrices @var{x}, and @var{y} from @code{meshdom} and +## Plot a mesh given matrices @var{x}, and @var{y} from @code{meshgrid} and ## a matrix @var{z} corresponding to the @var{x} and @var{y} coordinates of ## the mesh. If @var{x} and @var{y} are vectors, then a typical vertex ## is (@var{x}(j), @var{y}(i), @var{z}(i,j)). Thus, columns of @var{z} ## correspond to different @var{x} values and rows of @var{z} correspond ## to different @var{y} values. +## @seealso{meshgrid, mesh, contour} ## @end deftypefn -## @seealso{plot, semilogx, semilogy, loglog, polar, meshgrid, meshdom, -## contour, bar, stairs, __gnuplot_plot__, __gnuplot_splot__, replot, xlabel, ylabel, and title} + ## Author: John W. Eaton ## Modified: 2000-11-17 Paul Kienzle <kienzle.powernet.co.uk> @@ -38,88 +38,85 @@ ## Dmitri A. Sergatskov <dasergatskov@gmail.com> ## April 18, 2005 -function meshc (x, y, z) +## Modifed 2007-03-27 David Bateman +## Use new graphic handles interface - ## XXX FIXME XXX -- the plot states should really just be set - ## temporarily, probably inside an unwind_protect block, but there is - ## no way to determine their current values. +function meshc (varargin) + + newplot (); if (nargin == 1) - z = x; - if (is_matrix (z)) - __gnuplot_raw__ ("set nokey;\n"); - __gnuplot_raw__ ("set hidden3d;\n"); - __gnuplot_raw__ ("set data style lines;\n"); - __gnuplot_raw__ ("set surface;\n"); - __gnuplot_raw__ ("set contour;\n"); - __gnuplot_set__ noparametric; - __gnuplot_raw__ ("set view 60, 30, 1, 1;\n"); - __gnuplot_splot__ z' + z = varargin{1}; + if (ismatrix (z)) + [nr, nc] = size (z); + x = 1:nc; + y = (1:nr)'; else error ("meshc: argument must be a matrix"); endif elseif (nargin == 3) - if (isvector (x) && isvector (y) && is_matrix (z)) - xlen = length (x); - ylen = length (y); - if (xlen == columns (z) && ylen == rows (z)) - if (rows (y) == 1) - y = y'; - endif - len = 3 * xlen; - zz = zeros (ylen, len); - k = 1; - for i = 1:3:len - zz(:,i) = x(k) * ones (ylen, 1); - zz(:,i+1) = y; - zz(:,i+2) = z(:,k); - k++; - endfor - __gnuplot_raw__ ("set nokey;\n"); - __gnuplot_raw__ ("set hidden3d;\n"); - __gnuplot_raw__ ("set data style lines;\n"); - __gnuplot_raw__ ("set surface;\n"); - __gnuplot_raw__ ("set contour;\n"); - __gnuplot_set__ parametric; - __gnuplot_raw__ ("set view 60, 30, 1, 1;\n"); - __gnuplot_splot__ zz - __gnuplot_set__ noparametric ; + x = varargin{1}; + y = varargin{2}; + z = varargin{3}; + + if (isvector (x) && isvector (y) && ismatrix (z)) + if (rows (z) == length (y) && columns (z) == length (x)) + x = x(:)'; + y = y(:); else msg = "meshc: rows (z) must be the same as length (y) and"; msg = sprintf ("%s\ncolumns (z) must be the same as length (x)", msg); error (msg); endif - elseif (is_matrix (x) && is_matrix (y) && is_matrix (z)) - xlen = columns (z); - ylen = rows (z); - if (xlen == columns (x) && xlen == columns (y) && - ylen == rows (x) && ylen == rows(y)) - len = 3 * xlen; - zz = zeros (ylen, len); - k = 1; - for i = 1:3:len - zz(:,i) = x(:,k); - zz(:,i+1) = y(:,k); - zz(:,i+2) = z(:,k); - k++; - endfor - __gnuplot_raw__ ("set nokey;\n"); - __gnuplot_raw__ ("set hidden3d;\n"); - __gnuplot_raw__ ("set data style lines;\n"); - __gnuplot_raw__ ("set surface;\n"); - __gnuplot_raw__ ("set contour;\n"); - __gnuplot_set__ parametric; - __gnuplot_raw__ ("set view 60, 30, 1, 1;\n"); - __gnuplot_splot__ zz - __gnuplot_set__ noparametric; - else + elseif (ismatrix (x) && ismatrix (y) && ismatrix (z)) + if (! (size_equal (x, y) && size_equal (x, z))) error ("meshc: x, y, and z must have same dimensions"); endif else error ("meshc: x and y must be vectors and z must be a matrix"); endif else - usage ("meshc (z)"); + print_usage (); endif + ## make a default line object, and make it the current axes for the + ## current figure. + ca = gca (); + + tmp = __go_surface__ (ca, "xdata", x, "ydata", y, "zdata", z); + + set (ca, "view", [-37.5, 30]); + + hold on; + + [c, lev] = contourc (varargin{:}); + + cmap = get (gcf(), "colormap"); + + levx = linspace (min (lev), max (lev), size (cmap, 1)); + + drawnow(); + ax = axis(); + zmin = 2 * ax(5) - ax(6); + + ## decode contourc output format + i1 = 1; + while (i1 < length (c)) + + clev = c(1,i1); + clen = c(2,i1); + + ccr = interp1 (levx, cmap(:,1), clev); + ccg = interp1 (levx, cmap(:,2), clev); + ccb = interp1 (levx, cmap(:,3), clev); + + ii = i1+1:i1+clen; + line (c(1,ii), c(2,ii), zmin*ones(size(ii)), "color", [ccr, ccg, ccb]); + + i1 += c(2,i1)+1; + endwhile + + if (nargout > 0) + h = tmp; + endif endfunction
--- a/main/plot/inst/patch.m Fri Mar 23 20:31:14 2007 +0000 +++ b/main/plot/inst/patch.m Fri Mar 23 20:45:21 2007 +0000 @@ -7,7 +7,7 @@ ## ## You should have received a copy of the GNU General Public License ## along with this file; see the file COPYING. If not, write to the -## Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA +## Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA ## 02110-1301, USA. ## patch creates a pseudo-shaded patch with a black boundary @@ -48,7 +48,7 @@ Y=[y,y(1)]; plot(X,Y,borderc); unwind_protect_cleanup - if (!held) hold off; endif + if (!held), hold off; endif end_unwind_protect else if any (size(x) != size(y)) || any (size(x) != size(z)) @@ -64,7 +64,7 @@ Z=[z,z(1)]; plot3(X,Y,Z,borderc); unwind_protect_cleanup - if (!held) hold off; endif + if (!held), hold off; endif end_unwind_protect endif
--- a/main/plot/inst/peaks.m Fri Mar 23 20:31:14 2007 +0000 +++ b/main/plot/inst/peaks.m Fri Mar 23 20:45:21 2007 +0000 @@ -27,8 +27,13 @@ endif endif + if (!ismatrix(x) && !ismatrix(y)) + [X,Y] = meshgrid(x,y); + else + X = x; + Y = y; + endif - [X,Y] = meshgrid(x,y); Z = 3*(1-X).^2.*exp(-X.^2 - (Y+1).^2) \ - 10*(X/5 - X.^3 - Y.^5).*exp(-X.^2-Y.^2) \ - 1/3*exp(-(X+1).^2 - Y.^2);
--- a/main/plot/inst/pie.m Fri Mar 23 20:31:14 2007 +0000 +++ b/main/plot/inst/pie.m Fri Mar 23 20:45:21 2007 +0000 @@ -9,7 +9,7 @@ ## ## You should have received a copy of the GNU General Public License ## along with this file; see the file COPYING. If not, write to the Free -## Software Foundation, 59 Temple Place - Suite 330, Boston, MA +## Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA ## 02110-1301, USA. ## pie(Y)
--- a/main/plot/inst/quiver.m Fri Mar 23 20:31:14 2007 +0000 +++ b/main/plot/inst/quiver.m Fri Mar 23 20:45:21 2007 +0000 @@ -12,27 +12,30 @@ ## ## You should have received a copy of the GNU General Public License ## along with this program; see the file COPYING. If not, write to the Free -## Software Foundation, 59 Temple Place - Suite 330, Boston, MA +## Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA ## 02110-1301, USA. -## quiver (x, y, u, v) -## Plot the (u,v) components of a vector field in an (x,y) meshgrid. -## If the grid is uniform, you can specify x and y as vectors. +## -*- texinfo -*- +## @deftypefn {Function File} {} quiver (@var{x}, @var{y}, @var{u}, @var{v}) +## @deftypefnx {Function File} {} quiver (@var{u}, @var{v}) +## Plot the @code{(@var{u}, @var{v})} components of a vector field in +## an @code{(@var{x}, @var{y})} meshgrid. If the grid is uniform, you can +## specify @var{x} and @var{y} as vectors. ## -## quiver (u, v) -## Assume grid is uniform on (1:m,1:n) where [m,n]=size(u). +## If @var{x} and @var{y} are undefined they are assumed to be +## @code{(1:@var{m}, 1:@var{n})} where @code{[@var{m}, @var{n}] = +## size(@var{u})}. ## -## Example -## +## @group +## @example ## [x,y] = meshgrid(1:2:20); ## quiver(x,y,sin(2*pi*x/10),sin(2*pi*y/10)) +## @end example +## @end group ## -## The underlying gnuplot command is much richer than what we provide -## through quiver. With four column data M=[x,y,u,v], you can plot -## a vector field using '__gnuplot_plot__ M with vector ...'. -## -## See also: plot, semilogx, semilogy, loglog, polar, mesh, contour, -## bar, stairs, __gnuplot_plot__, __gnuplot_splot__, replot, xlabel, ylabel, title +## @seealso{plot, semilogx, semilogy, loglog, polar, mesh, contour, +## bar, stairs, replot, xlabel, ylabel, title} +## @end deftypefn ## Author: Roberto A. F. Almeida <roberto@calvin.ocfis.furg.br> ## Rewrite: Paul Kienzle <pkienzle@users.sf.net> @@ -60,7 +63,7 @@ endif M = [ x(:), y(:), u(:), v(:) ]; - __gnuplot_plot__ M w v t "" + __gnuplot_plot__ M w vec t "" endfunction %!demo @@ -72,6 +75,3 @@ %! x=linspace(0,3,80); y=sin(2*pi*x); theta=2*pi*x+pi/2; %! quiver(x,y,sin(theta)/10,cos(theta)/10); %! hold on; plot(x,y,';;'); hold off; - -%!demo -%! clf; % reset axis('equal') setting
--- a/main/plot/inst/tics.m Fri Mar 23 20:31:14 2007 +0000 +++ b/main/plot/inst/tics.m Fri Mar 23 20:45:21 2007 +0000 @@ -19,20 +19,12 @@ function tics(axis,pos,lab) if nargin == 1 - cmd = ["set ", axis, "tics autofreq;\n"]; - __gnuplot_raw__ (cmd); + set (gca(), "XTickMode", "auto"); elseif nargin == 2 - tics = sprintf(' %g,', pos); - tics(length(tics)) = ' '; - cmd = ["set ", axis, "tics (", tics, ");\n"]; - __gnuplot_raw__ (cmd); + set (gca(), "XTick", pos); elseif nargin == 3 - tics = sprintf('"%s" %g', deblank(lab(1,:)), pos(1)); - for i=2:rows(lab) - tics = [tics, sprintf(', "%s" %g', deblank(lab(i,:)), pos(i)) ]; - endfor - cmd = [ "set ", axis, "tics (", tics ,");\n"]; - __gnuplot_raw__ (cmd); + set (gca(), "XTick", pos); + set (gca(), "XTickLabel", lab); else usage("tics(axis,[pos1,pos2,...],['lab1';'lab2';...])"); endif