From: <and...@us...> - 2007-10-11 21:19:05
|
Revision: 7926 http://plplot.svn.sourceforge.net/plplot/?rev=7926&view=rev Author: andrewross Date: 2007-10-11 14:18:56 -0700 (Thu, 11 Oct 2007) Log Message: ----------- Initial commit to get plplot working with octave2.9. The changes should all be backward compatible so octave 2.1 is unaffected. The bindings now build on octave 2.9.12. Test examples all run. All x??o.psc files are identical with the equivalent c versions. The additional p??.psc examples are mostly producing consistent results between octave 2.1 and octave 2.9. Differences are present in p7, p8 and p15 due to problems with automatic_replot disappearing. Needs more interactive testing. Modified Paths: -------------- trunk/bindings/octave/PLplot/autostyle.m trunk/bindings/octave/PLplot/axis.m trunk/bindings/octave/PLplot/colormap.m trunk/bindings/octave/PLplot/figure.m trunk/bindings/octave/PLplot/grid.m trunk/bindings/octave/PLplot/label_plot.m trunk/bindings/octave/PLplot/legend.m trunk/bindings/octave/PLplot/lp_setup.m trunk/bindings/octave/PLplot/plot_margin.m trunk/bindings/octave/PLplot/plplot_octave_path.m.in trunk/bindings/octave/PLplot/plsetopt.m trunk/bindings/octave/PLplot/polar.m trunk/bindings/octave/PLplot/save_fig.m trunk/bindings/octave/PLplot/set_view.m trunk/bindings/octave/PLplot/shade.m trunk/bindings/octave/PLplot/shading.m trunk/bindings/octave/PLplot/support/__pl_contour.m trunk/bindings/octave/PLplot/support/__pl_fill.m trunk/bindings/octave/PLplot/support/__pl_matstr.m trunk/bindings/octave/PLplot/support/__pl_opt.m trunk/bindings/octave/PLplot/support/__pl_plotit.m trunk/bindings/octave/PLplot/support/__plt1__.m trunk/bindings/octave/PLplot/support/__plt2__.m trunk/bindings/octave/PLplot/support/__plt__.m trunk/bindings/octave/PLplot/tdeblank.m trunk/bindings/octave/PLplot/title.m trunk/bindings/octave/PLplot/xlabel.m trunk/bindings/octave/PLplot/xticks.m trunk/bindings/octave/PLplot/ylabel.m trunk/bindings/octave/PLplot/yticks.m trunk/bindings/octave/PLplot/zlabel.m trunk/bindings/octave/demos/p1.m trunk/bindings/octave/demos/p10.m trunk/bindings/octave/demos/p11.m trunk/bindings/octave/demos/p12.m trunk/bindings/octave/demos/p13.m trunk/bindings/octave/demos/p14.m trunk/bindings/octave/demos/p15.m trunk/bindings/octave/demos/p16.m trunk/bindings/octave/demos/p17.m trunk/bindings/octave/demos/p18.m trunk/bindings/octave/demos/p19.m trunk/bindings/octave/demos/p2.m trunk/bindings/octave/demos/p21.m trunk/bindings/octave/demos/p3.m trunk/bindings/octave/demos/p4.m trunk/bindings/octave/demos/p5.m trunk/bindings/octave/demos/p6.m trunk/bindings/octave/demos/p7.m trunk/bindings/octave/demos/p8.m trunk/bindings/octave/demos/p9.m Added Paths: ----------- trunk/bindings/octave/PLplot/hold.m trunk/bindings/octave/PLplot/ishold.m Modified: trunk/bindings/octave/PLplot/autostyle.m =================================================================== --- trunk/bindings/octave/PLplot/autostyle.m 2007-10-10 16:39:11 UTC (rev 7925) +++ trunk/bindings/octave/PLplot/autostyle.m 2007-10-11 21:18:56 UTC (rev 7926) @@ -24,7 +24,7 @@ strm = __pl_init; if (nargin == 1) - if (isstr (x)) + if (ischar (x)) if (strcmp ("off", x)) __pl.line_style(strm) = 0; elseif (strcmp ("on", x)) @@ -49,8 +49,10 @@ st = __pl.line_style(strm); - if (automatic_replot) - __pl_plotit; + if (exist("automatic_replot")) + if (automatic_replot) + __pl_plotit; + endif endif endfunction Modified: trunk/bindings/octave/PLplot/axis.m =================================================================== --- trunk/bindings/octave/PLplot/axis.m 2007-10-10 16:39:11 UTC (rev 7925) +++ trunk/bindings/octave/PLplot/axis.m 2007-10-11 21:18:56 UTC (rev 7926) @@ -67,7 +67,7 @@ __pl.axis_st(strm) = 0; __pl.aspect(strm) = 0; curr_axis = __pl.axis(strm,:); - elseif (nargin == 1 && isstr (ax)) + elseif (nargin == 1 && ischar (ax)) opt = ax; ax = []; elseif (nargin == 1 && is_vector (ax)) opt = ""; @@ -193,8 +193,10 @@ endswitch endif - if (automatic_replot) - __pl_plotit; + if (exist("automatic_replot")) + if (automatic_replot) + __pl_plotit; + endif endif endfunction Modified: trunk/bindings/octave/PLplot/colormap.m =================================================================== --- trunk/bindings/octave/PLplot/colormap.m 2007-10-10 16:39:11 UTC (rev 7925) +++ trunk/bindings/octave/PLplot/colormap.m 2007-10-11 21:18:56 UTC (rev 7926) @@ -42,7 +42,7 @@ return endif - if (nargin == 1 && isstr(map) && strcmp(map, 'default')) + if (nargin == 1 && ischar(map) && strcmp(map, 'default')) plscmap1n(0); n = 64; r = [zeros(n/2,1); linspace(0,1,n/2)']; @@ -68,9 +68,11 @@ plscmap1(map(:,1), map(:,2), map(:,3)); plflush;#pleop; - if (automatic_replot) - ## can cause problems on plot scripts that dont support automatic _replot - __pl_plotit; + if (exist("automatic_replot")) + if (automatic_replot) + ## can cause problems on plot scripts that dont support automatic _replot + __pl_plotit; + endif endif if (nargout) Modified: trunk/bindings/octave/PLplot/figure.m =================================================================== --- trunk/bindings/octave/PLplot/figure.m 2007-10-10 16:39:11 UTC (rev 7925) +++ trunk/bindings/octave/PLplot/figure.m 2007-10-11 21:18:56 UTC (rev 7926) @@ -65,10 +65,12 @@ __pl.inited = 1; - if (automatic_replot == 0) - warning("It is recommended that you set 'automatic_replot=1' \n\ - in your ~/.octaverc file."); - ##automatic_replot = 1; + if (exist("automatic_replot")) + if (automatic_replot == 0) + warning("It is recommended that you set 'automatic_replot=1' \n\ + in your ~/.octaverc file."); + ##automatic_replot = 1; + endif endif endif @@ -82,7 +84,7 @@ endif if (nargin != 0 || plglevel == 0) - __pl.hold(plgstrm+1) = ishold; # save current hold state + #__pl.hold(plgstrm+1) = ishold; # save current hold state plsstrm(n); n = plgstrm; strm = n+1; @@ -98,7 +100,7 @@ endif if (nargin >= 2 ) - if (isstr(device)) + if (ischar(device)) plsdev(device); else error("figure: `device' must be a string"); @@ -153,7 +155,7 @@ __pl.grid(strm) = 0; # grid state if (!struct_contains(__pl, "lab_str")) - __pl.lab_str(strm) = ""; # label string + __pl.lab_str = ""; # label string endif if (struct_contains(__pl, "xlabel")) Modified: trunk/bindings/octave/PLplot/grid.m =================================================================== --- trunk/bindings/octave/PLplot/grid.m 2007-10-10 16:39:11 UTC (rev 7925) +++ trunk/bindings/octave/PLplot/grid.m 2007-10-11 21:18:56 UTC (rev 7926) @@ -30,7 +30,7 @@ if (nargin == 0) __pl.grid(strm) = 1; elseif (nargin == 1) - if (isstr (x)) + if (ischar (x)) switch (x) case "off" __pl.grid(strm) = 0; @@ -57,8 +57,10 @@ help grid endif - if (automatic_replot) - __pl_plotit; + if (exist("automatic_replot")) + if (automatic_replot) + __pl_plotit; + endif endif endfunction Added: trunk/bindings/octave/PLplot/hold.m =================================================================== --- trunk/bindings/octave/PLplot/hold.m (rev 0) +++ trunk/bindings/octave/PLplot/hold.m 2007-10-11 21:18:56 UTC (rev 7926) @@ -0,0 +1,38 @@ +## Copyright (C) 2007 Andrew Ross +## +## This program is free software; you can redistribute it and/or modify it +## under the terms of the GNU General Public License as published by +## the Free Software Foundation; either version 2, or (at your option) +## any later version. +## +## This program is distributed in the hope that it will be useful, but +## WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +## General Public License for more details. +## +## This file is part of plplot_octave. + +## usage: hold on | off +## Tell Octave to `hold' the current data on the plot when executing +## subsequent plotting commands. This allows you to execute a series of +## plot commands and have all the lines end up on the same figure. The +## default is for each new plot command to clear the plot device first. +## + +function hold (arg) + + global __pl + + if (nargin ~= 1) + usage("hold on|off"); + end + + if (strcmpi(arg,"on") == 1) + __pl.hold(plgstrm+1) = 1; + elseif (strcmpi(arg,"off") == 1) + __pl.hold(plgstrm+1) = 0; + else + usage("hold on|off"); + end + +endfunction Added: trunk/bindings/octave/PLplot/ishold.m =================================================================== --- trunk/bindings/octave/PLplot/ishold.m (rev 0) +++ trunk/bindings/octave/PLplot/ishold.m 2007-10-11 21:18:56 UTC (rev 7926) @@ -0,0 +1,28 @@ +## Copyright (C) 2007 Andrew Ross. +## +## This program is free software; you can redistribute it and/or modify it +## under the terms of the GNU General Public License as published by +## the Free Software Foundation; either version 2, or (at your option) +## any later version. +## +## This program is distributed in the hope that it will be useful, but +## WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +## General Public License for more details. +## +## This file is part of plplot_octave. + +## usage: ishold +## +## Return 1 if the next line will be added to the current plot, or 0 if +## the plot device will be cleared before drawing the next line. +## + + +function a = ishold() + + global __pl + + a = __pl.hold(plgstrm+1); + +endfunction Modified: trunk/bindings/octave/PLplot/label_plot.m =================================================================== --- trunk/bindings/octave/PLplot/label_plot.m 2007-10-10 16:39:11 UTC (rev 7925) +++ trunk/bindings/octave/PLplot/label_plot.m 2007-10-11 21:18:56 UTC (rev 7926) @@ -61,7 +61,7 @@ cla = create_set(label); - if (nargin == 3 && isstr(class)) + if (nargin == 3 && ischar(class)) names = setstr(ones(max(cla),columns(class))*32); t=1;for i=cla; names(i,:) = class(t++,:); endfor elseif (nargin <= 3) @@ -84,7 +84,7 @@ ## else item = class'; ## endif - elseif (nargin == 3 && is_matrix(class) && !isstr(class)) + elseif (nargin == 3 && is_matrix(class) && !ischar(class)) item = []; ct = rows(class); if (nc != columns(class)) error("label_plot: `data' and `class' must have the same number of columns\n"); Modified: trunk/bindings/octave/PLplot/legend.m =================================================================== --- trunk/bindings/octave/PLplot/legend.m 2007-10-10 16:39:11 UTC (rev 7925) +++ trunk/bindings/octave/PLplot/legend.m 2007-10-11 21:18:56 UTC (rev 7926) @@ -39,11 +39,11 @@ elseif (nargin == 1 && is_scalar(x) && x >=0 && x <= 2) __pl.legend(strm) = x; - elseif (nargin == 2 && !isstr(x) && !isstr(xpos)) + elseif (nargin == 2 && !ischar(x) && !ischar(xpos)) __pl.legend_xpos(strm) = x; __pl.legend_ypos(strm) = xpos; - elseif (nargin >= 1 && isstr (x)) + elseif (nargin >= 1 && ischar (x)) if (strcmp ("off", x)) __pl.legend(strm) = 0; elseif (strcmp ("on", x) || strcmp ("transparent", x)) @@ -52,7 +52,7 @@ __pl.legend(strm) = 2; elseif (strcmp ("set", x)) - if (nargin >= 2 && isstr(xpos)) + if (nargin >= 2 && ischar(xpos)) __pl.fmt{1,1} = xpos; i=2; while (--nargin > 1) @@ -66,8 +66,10 @@ help "legend" endif - if (automatic_replot) - __pl_plotit; + if (exist("automatic_replot")) + if (automatic_replot) + __pl_plotit; + endif endif endfunction Modified: trunk/bindings/octave/PLplot/lp_setup.m =================================================================== --- trunk/bindings/octave/PLplot/lp_setup.m 2007-10-10 16:39:11 UTC (rev 7925) +++ trunk/bindings/octave/PLplot/lp_setup.m 2007-10-11 21:18:56 UTC (rev 7926) @@ -26,7 +26,7 @@ __pl.lp_options = "lpr"; endif - if (nargin == 1 && isstr(command)) + if (nargin == 1 && ischar(command)) __pl.lp_options = command; endif Modified: trunk/bindings/octave/PLplot/plot_margin.m =================================================================== --- trunk/bindings/octave/PLplot/plot_margin.m 2007-10-10 16:39:11 UTC (rev 7925) +++ trunk/bindings/octave/PLplot/plot_margin.m 2007-10-11 21:18:56 UTC (rev 7926) @@ -30,8 +30,10 @@ __pl.margin(n) = st; endif - if (automatic_replot) - __pl_plotit; + if (exist("automatic_replot")) + if (automatic_replot) + __pl_plotit; + endif endif endfunction Modified: trunk/bindings/octave/PLplot/plplot_octave_path.m.in =================================================================== --- trunk/bindings/octave/PLplot/plplot_octave_path.m.in 2007-10-10 16:39:11 UTC (rev 7925) +++ trunk/bindings/octave/PLplot/plplot_octave_path.m.in 2007-10-11 21:18:56 UTC (rev 7926) @@ -27,7 +27,7 @@ if (nargin == 0) path = __pl_plplot_octave_path; - elseif (nargin == 1 && isstr(path)) + elseif (nargin == 1 && ischar(path)) if (path(length (path)) != '/') path = [path "//"]; elseif (path(length (path)-1) != '/') Modified: trunk/bindings/octave/PLplot/plsetopt.m =================================================================== --- trunk/bindings/octave/PLplot/plsetopt.m 2007-10-10 16:39:11 UTC (rev 7925) +++ trunk/bindings/octave/PLplot/plsetopt.m 2007-10-11 21:18:56 UTC (rev 7926) @@ -80,7 +80,7 @@ ret = ""; - if (nargin == 0 || (nargin >= 1 && !isstr(option)) || (nargin == 2 && !isstr(value))) + if (nargin == 0 || (nargin >= 1 && !ischar(option)) || (nargin == 2 && !ischar(value))) help "plsetopt" return endif Modified: trunk/bindings/octave/PLplot/polar.m =================================================================== --- trunk/bindings/octave/PLplot/polar.m 2007-10-10 16:39:11 UTC (rev 7925) +++ trunk/bindings/octave/PLplot/polar.m 2007-10-11 21:18:56 UTC (rev 7926) @@ -34,12 +34,12 @@ endif if (nargin == 3) - if (!isstr (fmt)) + if (!ischar (fmt)) error ("polar: third argument must be a string"); endif __plr2__ (x1, x2, fmt); elseif (nargin == 2) - if (isstr (x2)) + if (ischar (x2)) __plr1__ (x1, fmt); else fmt = ""; Modified: trunk/bindings/octave/PLplot/save_fig.m =================================================================== --- trunk/bindings/octave/PLplot/save_fig.m 2007-10-10 16:39:11 UTC (rev 7925) +++ trunk/bindings/octave/PLplot/save_fig.m 2007-10-11 21:18:56 UTC (rev 7926) @@ -88,7 +88,7 @@ device = dev; - if (nargin >= 1 && isstr(device) & isstr(file)) + if (nargin >= 1 && ischar(device) & ischar(file)) to_prt = 0; if (strcmp(file,"|lp")) # special output file, printer! Modified: trunk/bindings/octave/PLplot/set_view.m =================================================================== --- trunk/bindings/octave/PLplot/set_view.m 2007-10-10 16:39:11 UTC (rev 7925) +++ trunk/bindings/octave/PLplot/set_view.m 2007-10-11 21:18:56 UTC (rev 7926) @@ -42,11 +42,11 @@ callback = 0; - if (nargin == 2 && !isstr(alt)) + if (nargin == 2 && !ischar(alt)) __pl.az(strm) = az; __pl.alt(strm) = alt; return - elseif (nargin >= 2 && isstr(alt)) + elseif (nargin >= 2 && ischar(alt)) cmd = alt; arg1 = az; callback = 1; Modified: trunk/bindings/octave/PLplot/shade.m =================================================================== --- trunk/bindings/octave/PLplot/shade.m 2007-10-10 16:39:11 UTC (rev 7925) +++ trunk/bindings/octave/PLplot/shade.m 2007-10-11 21:18:56 UTC (rev 7926) @@ -26,11 +26,15 @@ global __pl strm = __pl_init; - old_empty_list_elements_ok = warn_empty_list_elements; - unwind_protect - warn_empty_list_elements = 0; + if (exist("warn_empty_list_elements")) + old_empty_list_elements_ok = warn_empty_list_elements; + warn_empty_list_elements = 0; + else + old_empty_list_elements_ok = warning("query", "Octave:empty-list-elements"); + warning("off","Octave:empty-list-elements"); + endif if (nargin == 1 && is_matrix(x)) levels = 20; @@ -173,7 +177,11 @@ unwind_protect_cleanup - warn_empty_list_elements = old_empty_list_elements_ok; + if (exist("warn_empty_list_elements")) + warn_empty_list_elements = old_empty_list_elements_ok; + else + warning(old_empty_list_elements_ok.state, "Octave:empty-list-elements"); + endif end_unwind_protect Modified: trunk/bindings/octave/PLplot/shading.m =================================================================== --- trunk/bindings/octave/PLplot/shading.m 2007-10-10 16:39:11 UTC (rev 7925) +++ trunk/bindings/octave/PLplot/shading.m 2007-10-11 21:18:56 UTC (rev 7926) @@ -35,8 +35,10 @@ return; endif - if (automatic_replot) - __pl_plotit; + if (exist("automatic_replot")) + if (automatic_replot) + __pl_plotit; + endif endif endfunction Modified: trunk/bindings/octave/PLplot/support/__pl_contour.m =================================================================== --- trunk/bindings/octave/PLplot/support/__pl_contour.m 2007-10-10 16:39:11 UTC (rev 7925) +++ trunk/bindings/octave/PLplot/support/__pl_contour.m 2007-10-11 21:18:56 UTC (rev 7926) @@ -19,18 +19,22 @@ strm = plgstrm+1; - old_empty_list_elements_ok = warn_empty_list_elements; - unwind_protect + if (exist("warn_empty_list_elements")) + old_empty_list_elements_ok = warn_empty_list_elements; warn_empty_list_elements = 0; + else + old_empty_list_elements_ok = warning("query","Octave:empty-list-elements"); + warning("off","Octave:empty-list-elements"); + endif grid = 0; if (__pl.grid(strm)) grid = 2; endif - if (ishold == 0) + if (ishold== 0) xm = min(min(x)); xM = max(max(x)); ym = min(min(y)); yM = max(max(y)); zm = min(min(z)); zM = max(max(z)); @@ -113,7 +117,11 @@ unwind_protect_cleanup - warn_empty_list_elements = old_empty_list_elements_ok; + if (exist("warn_empty_list_elements")) + warn_empty_list_elements = old_empty_list_elements_ok; + else + warning(old_empty_list_elements_ok.state,"Octave:empty-list-elements"); + endif end_unwind_protect Modified: trunk/bindings/octave/PLplot/support/__pl_fill.m =================================================================== --- trunk/bindings/octave/PLplot/support/__pl_fill.m 2007-10-10 16:39:11 UTC (rev 7925) +++ trunk/bindings/octave/PLplot/support/__pl_fill.m 2007-10-11 21:18:56 UTC (rev 7926) @@ -55,7 +55,7 @@ __pl_plenv(min(x), max(x), min(y), max(y), 0, -1); endif - if (isstr(c) & length(c) == 1) + if (ischar(c) & length(c) == 1) ## map to plplot color coln = ['r','g','b','c','m','y','w','k']; coli = [2, 4, 10, 12, 14, 3, 16, 1]; Modified: trunk/bindings/octave/PLplot/support/__pl_matstr.m =================================================================== --- trunk/bindings/octave/PLplot/support/__pl_matstr.m 2007-10-10 16:39:11 UTC (rev 7925) +++ trunk/bindings/octave/PLplot/support/__pl_matstr.m 2007-10-11 21:18:56 UTC (rev 7926) @@ -20,8 +20,7 @@ function out = __pl_matstr(mat, str, n) ## Octave damned string arrays are defective! - - if (isstr(str) & isstr(mat) & rows(str) == 1) + if (ischar(str) & ischar(mat) & rows(str) == 1) if (isempty(mat)) out(n,:) = str; else @@ -35,10 +34,18 @@ out(nn,:) = ""; endif endif - old_dofi = warn_fortran_indexing; - warn_fortran_indexing = 0; - out(toascii (out) == 0) = " "; - warn_fortran_indexing = old_dofi; + if (exist("warn_fortran_indexing")) + old_dofi = warn_fortran_indexing; + warn_fortran_indexing = 0; + out(toascii (out) == 0) = " "; + warn_fortran_indexing = old_dofi; + else + old_dofi = warning("query","Octave:fortran-indexing"); + warning("off","Octave:fortran-indexing"); + out(toascii (out) == 0) = " "; + warning(old_dofi.state,"Octave:fortran-indexing"); + endif + else help __pl_matstr endif Modified: trunk/bindings/octave/PLplot/support/__pl_opt.m =================================================================== --- trunk/bindings/octave/PLplot/support/__pl_opt.m 2007-10-10 16:39:11 UTC (rev 7925) +++ trunk/bindings/octave/PLplot/support/__pl_opt.m 2007-10-11 21:18:56 UTC (rev 7926) @@ -131,7 +131,7 @@ usage ("__pl_opt (opt)"); endif - if (! isstr (opt)) + if (! ischar (opt)) error ("__pl_opt: argument must be a string"); endif Modified: trunk/bindings/octave/PLplot/support/__pl_plotit.m =================================================================== --- trunk/bindings/octave/PLplot/support/__pl_plotit.m 2007-10-10 16:39:11 UTC (rev 7925) +++ trunk/bindings/octave/PLplot/support/__pl_plotit.m 2007-10-11 21:18:56 UTC (rev 7926) @@ -26,11 +26,15 @@ return endif - old_empty_list_elements_ok = warn_empty_list_elements; - unwind_protect - warn_empty_list_elements = 0; + if (exist("warn_empty_list_elements")) + old_empty_list_elements_ok = warn_empty_list_elements; + warn_empty_list_elements = 0; + else + old_empty_list_elements_ok = warning("query","Octave:empty-list-elements"); + warning("off","Octave:empty-list-elements"); + endif if (__pl.type(strm) >= 100 && __pl.type(strm) < 200) __pl_meshplotit; @@ -281,9 +285,13 @@ plflush; unwind_protect_cleanup - - warn_empty_list_elements = old_empty_list_elements_ok; + if (exist("warn_empty_list_elements")) + warn_empty_list_elements = old_empty_list_elements_ok; + else + warning(old_empty_list_elements_ok.state,"Octave:empty-list-elements"); + endif + end_unwind_protect endfunction Modified: trunk/bindings/octave/PLplot/support/__plt1__.m =================================================================== --- trunk/bindings/octave/PLplot/support/__plt1__.m 2007-10-10 16:39:11 UTC (rev 7925) +++ trunk/bindings/octave/PLplot/support/__plt1__.m 2007-10-11 21:18:56 UTC (rev 7926) @@ -25,7 +25,7 @@ fmt = ""; endif - if (! isstr (fmt)) + if (! ischar (fmt)) error ("__plt1__: fmt must be a string"); endif Modified: trunk/bindings/octave/PLplot/support/__plt2__.m =================================================================== --- trunk/bindings/octave/PLplot/support/__plt2__.m 2007-10-10 16:39:11 UTC (rev 7925) +++ trunk/bindings/octave/PLplot/support/__plt2__.m 2007-10-11 21:18:56 UTC (rev 7926) @@ -25,7 +25,7 @@ fmt = ""; endif - if (! isstr (fmt)) + if (! ischar (fmt)) error ("__plt2__: fmt must be a string"); endif Modified: trunk/bindings/octave/PLplot/support/__plt__.m =================================================================== --- trunk/bindings/octave/PLplot/support/__plt__.m 2007-10-10 16:39:11 UTC (rev 7925) +++ trunk/bindings/octave/PLplot/support/__plt__.m 2007-10-11 21:18:56 UTC (rev 7926) @@ -46,7 +46,7 @@ elseif (nargin > 2) - hold_state = ishold (); + hold_state = ishold; unwind_protect @@ -63,7 +63,7 @@ fmt = ""; new = varargin{k++}; - if (isstr (new)) + if (ischar (new)) if (! x_set) error ("plot: no data to plot"); endif Modified: trunk/bindings/octave/PLplot/tdeblank.m =================================================================== --- trunk/bindings/octave/PLplot/tdeblank.m 2007-10-10 16:39:11 UTC (rev 7925) +++ trunk/bindings/octave/PLplot/tdeblank.m 2007-10-11 21:18:56 UTC (rev 7926) @@ -26,7 +26,7 @@ usage ("tdeblank (s)"); endif - if (isstr (s)) + if (ischar (s)) [nr, nc] = size (s); len = nr * nc; Modified: trunk/bindings/octave/PLplot/title.m =================================================================== --- trunk/bindings/octave/PLplot/title.m 2007-10-10 16:39:11 UTC (rev 7925) +++ trunk/bindings/octave/PLplot/title.m 2007-10-11 21:18:56 UTC (rev 7926) @@ -57,8 +57,10 @@ __pl.tlabel = __pl_matstr(__pl.tlabel, text, strm); endif - if (automatic_replot) - __pl_plotit; + if (exist("automatic_replot")) + if (automatic_replot) + __pl_plotit; + endif endif endfunction Modified: trunk/bindings/octave/PLplot/xlabel.m =================================================================== --- trunk/bindings/octave/PLplot/xlabel.m 2007-10-10 16:39:11 UTC (rev 7925) +++ trunk/bindings/octave/PLplot/xlabel.m 2007-10-11 21:18:56 UTC (rev 7926) @@ -38,8 +38,10 @@ __pl.xlabel = __pl_matstr(__pl.xlabel, text, strm); endif - if (automatic_replot) - __pl_plotit; + if (exist("automatic_replot")) + if (automatic_replot) + __pl_plotit; + endif endif endfunction Modified: trunk/bindings/octave/PLplot/xticks.m =================================================================== --- trunk/bindings/octave/PLplot/xticks.m 2007-10-10 16:39:11 UTC (rev 7925) +++ trunk/bindings/octave/PLplot/xticks.m 2007-10-11 21:18:56 UTC (rev 7926) @@ -55,8 +55,10 @@ endif endif - if (automatic_replot) - __pl_plotit; + if (exist("automatic_replot")) + if (automatic_replot) + __pl_plotit; + endif endif endfunction Modified: trunk/bindings/octave/PLplot/ylabel.m =================================================================== --- trunk/bindings/octave/PLplot/ylabel.m 2007-10-10 16:39:11 UTC (rev 7925) +++ trunk/bindings/octave/PLplot/ylabel.m 2007-10-11 21:18:56 UTC (rev 7926) @@ -38,8 +38,10 @@ __pl.ylabel = __pl_matstr(__pl.ylabel, text, strm); endif - if (automatic_replot) - __pl_plotit; + if (exist("automatic_replot")) + if (automatic_replot) + __pl_plotit; + endif endif endfunction Modified: trunk/bindings/octave/PLplot/yticks.m =================================================================== --- trunk/bindings/octave/PLplot/yticks.m 2007-10-10 16:39:11 UTC (rev 7925) +++ trunk/bindings/octave/PLplot/yticks.m 2007-10-11 21:18:56 UTC (rev 7926) @@ -55,8 +55,10 @@ endif endif - if (automatic_replot) - __pl_plotit; + if (exist("automatic_replot")) + if (automatic_replot) + __pl_plotit; + endif endif endfunction Modified: trunk/bindings/octave/PLplot/zlabel.m =================================================================== --- trunk/bindings/octave/PLplot/zlabel.m 2007-10-10 16:39:11 UTC (rev 7925) +++ trunk/bindings/octave/PLplot/zlabel.m 2007-10-11 21:18:56 UTC (rev 7926) @@ -38,8 +38,10 @@ __pl.zlabel = __pl_matstr(__pl.zlabel, text, strm); endif - if (automatic_replot) - __pl_plotit; + if (exist("automatic_replot")) + if (automatic_replot) + __pl_plotit; + endif endif endfunction Modified: trunk/bindings/octave/demos/p1.m =================================================================== --- trunk/bindings/octave/demos/p1.m 2007-10-10 16:39:11 UTC (rev 7925) +++ trunk/bindings/octave/demos/p1.m 2007-10-11 21:18:56 UTC (rev 7926) @@ -15,8 +15,10 @@ function p1 - t = automatic_replot; - automatic_replot = 0; + if (exist("automatic_replot")) + t = automatic_replot; + automatic_replot = 0; + endif xscale = 6.; yscale = 1.; @@ -39,7 +41,9 @@ plot(x, y, xs, ys, 'og; ;'); - automatic_replot = t; + if (exist("automatic_replot")) + automatic_replot = t; + endif endfunction Modified: trunk/bindings/octave/demos/p10.m =================================================================== --- trunk/bindings/octave/demos/p10.m 2007-10-10 16:39:11 UTC (rev 7925) +++ trunk/bindings/octave/demos/p10.m 2007-10-11 21:18:56 UTC (rev 7926) @@ -15,8 +15,10 @@ function p10 - t = automatic_replot; - automatic_replot = 0; + if (exist("automatic_replot")) + t = automatic_replot; + automatic_replot = 0; + endif title("Comet"); xlabel ""; @@ -24,7 +26,9 @@ t = -pi:pi/200:0; comet(t,tan(sin(t))-sin(tan(t))); - automatic_replot = t; + if (exist("automatic_replot")) + automatic_replot = t; + endif endfunction Modified: trunk/bindings/octave/demos/p11.m =================================================================== --- trunk/bindings/octave/demos/p11.m 2007-10-10 16:39:11 UTC (rev 7925) +++ trunk/bindings/octave/demos/p11.m 2007-10-11 21:18:56 UTC (rev 7926) @@ -14,8 +14,10 @@ function p11 - t = automatic_replot; - automatic_replot = 0; + if (exist("automatic_replot")) + t = automatic_replot; + automatic_replot = 0; + endif title("Stripchart demo 1 (sliding)"); xlabel("Time"); @@ -48,6 +50,8 @@ ## Destroy strip chart and it's memory */ stripc_del(id1); - automatic_replot = t; + if (exist("automatic_replot")) + automatic_replot = t; + endif endfunction Modified: trunk/bindings/octave/demos/p12.m =================================================================== --- trunk/bindings/octave/demos/p12.m 2007-10-10 16:39:11 UTC (rev 7925) +++ trunk/bindings/octave/demos/p12.m 2007-10-11 21:18:56 UTC (rev 7926) @@ -14,8 +14,10 @@ function p12 - t = automatic_replot; - automatic_replot = 0; + if (exist("automatic_replot")) + t = automatic_replot; + automatic_replot = 0; + endif title("War Game"); legend("off"); @@ -30,6 +32,8 @@ endif legend("on"); - automatic_replot = t; + if (exist("automatic_replot")) + automatic_replot = t; + endif endfunction Modified: trunk/bindings/octave/demos/p13.m =================================================================== --- trunk/bindings/octave/demos/p13.m 2007-10-10 16:39:11 UTC (rev 7925) +++ trunk/bindings/octave/demos/p13.m 2007-10-11 21:18:56 UTC (rev 7926) @@ -14,8 +14,10 @@ function p13 - t = automatic_replot; - automatic_replot = 0; + if (exist("automatic_replot")) + t = automatic_replot; + automatic_replot = 0; + endif legend("opaque"); title("Matrix with individual line attributes"); @@ -34,6 +36,8 @@ ## plot(randn(10,3),fmt) plot(g,fmt) - automatic_replot = t; + if (exist("automatic_replot")) + automatic_replot = t; + endif endfunction Modified: trunk/bindings/octave/demos/p14.m =================================================================== --- trunk/bindings/octave/demos/p14.m 2007-10-10 16:39:11 UTC (rev 7925) +++ trunk/bindings/octave/demos/p14.m 2007-10-11 21:18:56 UTC (rev 7926) @@ -17,8 +17,10 @@ ## And now, in the Theatre near you, "Octave, the movie" - t = automatic_replot; - automatic_replot = 0; + if (exist("automatic_replot")) + t = automatic_replot; + automatic_replot = 0; + endif if (!nargin) plsetopt "db"; @@ -62,8 +64,10 @@ closefig; # the "db" option has negative side effects on other plots. plsetopt "reset"; # reset options endif - automatic_replot = t; - + if (exist("automatic_replot")) + automatic_replot = t; + endif + endfunction Modified: trunk/bindings/octave/demos/p15.m =================================================================== --- trunk/bindings/octave/demos/p15.m 2007-10-10 16:39:11 UTC (rev 7925) +++ trunk/bindings/octave/demos/p15.m 2007-10-11 21:18:56 UTC (rev 7926) @@ -15,8 +15,10 @@ function p15 - t = automatic_replot; - automatic_replot = 0; + if (exist("automatic_replot")) + t = automatic_replot; + automatic_replot = 0; + endif title "Lighted and shaded surface"; xlabel ""; @@ -33,7 +35,9 @@ surf(x, y, z); colormap('default'); - automatic_replot = t; + if (exist("automatic_replot")) + automatic_replot = t; + endif endfunction Modified: trunk/bindings/octave/demos/p16.m =================================================================== --- trunk/bindings/octave/demos/p16.m 2007-10-10 16:39:11 UTC (rev 7925) +++ trunk/bindings/octave/demos/p16.m 2007-10-11 21:18:56 UTC (rev 7926) @@ -14,8 +14,10 @@ function p16 - t = automatic_replot; - automatic_replot = 0; + if (exist("automatic_replot")) + t = automatic_replot; + automatic_replot = 0; + endif multiplot(1, 2); p1; @@ -29,6 +31,8 @@ shade(x, y, z); oneplot; - automatic_replot = t; + if (exist("automatic_replot")) + automatic_replot = t; + endif endfunction Modified: trunk/bindings/octave/demos/p17.m =================================================================== --- trunk/bindings/octave/demos/p17.m 2007-10-10 16:39:11 UTC (rev 7925) +++ trunk/bindings/octave/demos/p17.m 2007-10-11 21:18:56 UTC (rev 7926) @@ -14,8 +14,10 @@ function p17(fg) - t = automatic_replot; - automatic_replot = 0; + if (exist("automatic_replot")) + t = automatic_replot; + automatic_replot = 0; + endif title "Click and Drag button 1 to select"; xlabel "Button 2 to restart and button 3 to finish"; @@ -30,6 +32,8 @@ plimage (img, x1, x2, y1, y2); endif - automatic_replot = t; - -endfunction \ No newline at end of file + if (exist("automatic_replot")) + automatic_replot = t; + endif + +endfunction Modified: trunk/bindings/octave/demos/p18.m =================================================================== --- trunk/bindings/octave/demos/p18.m 2007-10-10 16:39:11 UTC (rev 7925) +++ trunk/bindings/octave/demos/p18.m 2007-10-11 21:18:56 UTC (rev 7926) @@ -14,8 +14,10 @@ function p18 - t = automatic_replot; - automatic_replot = 0; + if (exist("automatic_replot")) + t = automatic_replot; + automatic_replot = 0; + endif plsetopt "db"; fig( free_fig); # unused plot window @@ -31,6 +33,8 @@ set_view("meshc", x, y, z); closefig - automatic_replot = 0; + if (exist("automatic_replot")) + automatic_replot = 0; + endif -endfunction \ No newline at end of file +endfunction Modified: trunk/bindings/octave/demos/p19.m =================================================================== --- trunk/bindings/octave/demos/p19.m 2007-10-10 16:39:11 UTC (rev 7925) +++ trunk/bindings/octave/demos/p19.m 2007-10-11 21:18:56 UTC (rev 7926) @@ -14,8 +14,10 @@ function p19 - t = automatic_replot; - automatic_replot = 0; + if (exist("automatic_replot")) + t = automatic_replot; + automatic_replot = 0; + endif f0=figure; multiplot(1,2); @@ -98,6 +100,8 @@ closefig(f1); oneplot; - automatic_replot = t; + if (exist("automatic_replot")) + automatic_replot = t; + endif endfunction Modified: trunk/bindings/octave/demos/p2.m =================================================================== --- trunk/bindings/octave/demos/p2.m 2007-10-10 16:39:11 UTC (rev 7925) +++ trunk/bindings/octave/demos/p2.m 2007-10-11 21:18:56 UTC (rev 7926) @@ -14,8 +14,10 @@ function p2 - t = automatic_replot; - automatic_replot = 0; + if (exist("automatic_replot")) + t = automatic_replot; + automatic_replot = 0; + endif legend("opaque",0) title("PLplot Example 2"); @@ -28,7 +30,9 @@ x, y2, 'b;sin(x)*cos(2*x);', x, y3, 'g;x*sin(x);'); - automatic_replot = t; - + if (exist("automatic_replot")) + automatic_replot = t; + endif + endfunction Modified: trunk/bindings/octave/demos/p21.m =================================================================== --- trunk/bindings/octave/demos/p21.m 2007-10-10 16:39:11 UTC (rev 7925) +++ trunk/bindings/octave/demos/p21.m 2007-10-11 21:18:56 UTC (rev 7926) @@ -20,8 +20,10 @@ ##ocmap = colormap; colormap(bgr); - t = automatic_replot; - automatic_replot = 0; + if (exist("automatic_replot")) + t = automatic_replot; + automatic_replot = 0; + endif gx = 30; gy = 40; @@ -57,7 +59,9 @@ meshc(xg, yg, zg'); endfor - automatic_replot = t; + if (exist("automatic_replot")) + automatic_replot = t; + endif ##colormap(ocmap); -endfunction \ No newline at end of file +endfunction Modified: trunk/bindings/octave/demos/p3.m =================================================================== --- trunk/bindings/octave/demos/p3.m 2007-10-10 16:39:11 UTC (rev 7925) +++ trunk/bindings/octave/demos/p3.m 2007-10-11 21:18:56 UTC (rev 7926) @@ -14,8 +14,10 @@ function p3 - t = automatic_replot; - automatic_replot = 0; + if (exist("automatic_replot")) + t = automatic_replot; + automatic_replot = 0; + endif xscale = 6.; yscale = 1.; @@ -37,6 +39,8 @@ title("#frPLplot Example 3 - y=x#u2 #d(with error bars)"); plot(x, y, [xs' xe'], [ys' yel' yer'], '~g; ;'); - automatic_replot = t; + if (exist("automatic_replot")) + automatic_replot = t; + endif endfunction Modified: trunk/bindings/octave/demos/p4.m =================================================================== --- trunk/bindings/octave/demos/p4.m 2007-10-10 16:39:11 UTC (rev 7925) +++ trunk/bindings/octave/demos/p4.m 2007-10-11 21:18:56 UTC (rev 7926) @@ -14,9 +14,11 @@ function p4 - t = automatic_replot; - automatic_replot = 0; - + if (exist("automatic_replot")) + t = automatic_replot; + automatic_replot = 0; + endif + x=0.01:0.1:10; y=exp(x); @@ -25,6 +27,8 @@ loglog(x,y,'y') grid (og); - automatic_replot = t; + if (exist("automatic_replot")) + automatic_replot = t; + endif endfunction Modified: trunk/bindings/octave/demos/p5.m =================================================================== --- trunk/bindings/octave/demos/p5.m 2007-10-10 16:39:11 UTC (rev 7925) +++ trunk/bindings/octave/demos/p5.m 2007-10-11 21:18:56 UTC (rev 7926) @@ -14,8 +14,10 @@ function p5 - t = automatic_replot; - automatic_replot = 0; + if (exist("automatic_replot")) + t = automatic_replot; + automatic_replot = 0; + endif x=-pi:0.01:pi; y=sin(x).+cos(3*x); @@ -25,6 +27,8 @@ polar(x,y,'y') grid (og); - automatic_replot = t; + if (exist("automatic_replot")) + automatic_replot = t; + endif endfunction Modified: trunk/bindings/octave/demos/p6.m =================================================================== --- trunk/bindings/octave/demos/p6.m 2007-10-10 16:39:11 UTC (rev 7925) +++ trunk/bindings/octave/demos/p6.m 2007-10-11 21:18:56 UTC (rev 7926) @@ -16,8 +16,10 @@ [x y z] = rosenbrock; z = log(z); - t = automatic_replot; - automatic_replot = 0; + if (exist("automatic_replot")) + t = automatic_replot; + automatic_replot = 0; + endif as = autostyle; autostyle "off"; @@ -26,6 +28,8 @@ contour(x,y,z) autostyle(as); - automatic_replot = t; + if (exist("automatic_replot")) + automatic_replot = t; + endif endfunction Modified: trunk/bindings/octave/demos/p7.m =================================================================== --- trunk/bindings/octave/demos/p7.m 2007-10-10 16:39:11 UTC (rev 7925) +++ trunk/bindings/octave/demos/p7.m 2007-10-11 21:18:56 UTC (rev 7926) @@ -14,8 +14,10 @@ function p7 - t = automatic_replot; - automatic_replot = 0; + if (exist("automatic_replot")) + t = automatic_replot; + automatic_replot = 0; + endif [x y z]=rosenbrock;z=log(z); @@ -34,5 +36,7 @@ shade(x,y,z,15,3); axis; - automatic_replot = t; + if (exist("automatic_replot")) + automatic_replot = t; + endif endfunction Modified: trunk/bindings/octave/demos/p8.m =================================================================== --- trunk/bindings/octave/demos/p8.m 2007-10-10 16:39:11 UTC (rev 7925) +++ trunk/bindings/octave/demos/p8.m 2007-10-11 21:18:56 UTC (rev 7926) @@ -14,8 +14,10 @@ function p8 - t = automatic_replot; - automatic_replot = 0; + if (exist("automatic_replot")) + t = automatic_replot; + automatic_replot = 0; + endif xlabel("X"); ylabel("Y"); title("Mesh example"); @@ -25,7 +27,9 @@ pause(1); meshc(x,y,z) - automatic_replot = t; + if (exist("automatic_replot")) + automatic_replot = t; + endif endfunction Modified: trunk/bindings/octave/demos/p9.m =================================================================== --- trunk/bindings/octave/demos/p9.m 2007-10-10 16:39:11 UTC (rev 7925) +++ trunk/bindings/octave/demos/p9.m 2007-10-11 21:18:56 UTC (rev 7926) @@ -14,8 +14,10 @@ function p9 - t = automatic_replot; - automatic_replot = 0; + if (exist("automatic_replot")) + t = automatic_replot; + automatic_replot = 0; + endif as = autostyle; autostyle ("off"); @@ -38,6 +40,8 @@ legend(ls); autostyle(as); - automatic_replot = t; + if (exist("automatic_replot")) + automatic_replot = t; + endif endfunction This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |