* Bug #13731 fixed - xmlDelete could be very slow.
+* Bug #13733 fixed - fmt could not be used as a singular optional argument in colorbar.
+
* Bug #13741 fixed - Impossible to print an invisible figure under Windows.
* Bug #13742 fixed - Figure was not well printed when there is a xstring with latex.
// are also available at
// http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
-function colorbar(varargin)
+function colorbar(umin, umax, colminmax, fmt)
// PURPOSE
// Draw a colorbar for a plot3d, fec, Sgrayplot, etc...
// see the help page
// Check number of input argument
- if size(varargin)<2 | size(varargin)>4 then
+ [lhs, rhs] = argn();
+ if rhs <= 2 then
error(msprintf(gettext("%s: Wrong number of input arguments: %d to %d expected.\n"), "colorbar", 2, 4));
end
- umin=varargin(1);
- umax=varargin(2);
- if size(varargin) > 2 then
- colminmax=varargin(3);
- end
- if size(varargin) > 3 then
- fmt=varargin(4);
- end
-
nb_grad = 5
if ~exists("fmt","local") then
- fmt="%-5.2g"
+ fmt="%-5.2g";
else
if type(fmt)<>10|size(fmt,"*")<>1 then
error(msprintf(gettext("%s: Wrong type for input argument #%d: %s data structure expected.\n"), "colorbar", 4, "string (containing a C format)"));
--- /dev/null
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Author: Ishit Mehta (ibm)
+// Copyright (C) 2015
+//
+// This file is distributed under the same license as the Scilab package.
+// =============================================================================
+// <-- TEST WITH GRAPHIC -->
+// <-- Non-regression test for bug 13733 -->
+//
+// <-- Bugzilla URL -->
+// http://bugzilla.scilab.org/show_bug.cgi?id=13733
+//
+// <-- Short Description -->
+// Optional arguments did not work properly. e.g colorbar(1,10,fmt="%d").
+colorbar(1,10,fmt="%d");
+colorbar(1,10,[1,10],fmt="%d");
+colorbar(1,10,fmt="%d", colminmax=[1,10]);
\ No newline at end of file
--- /dev/null
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Author: Ishit Mehta (ibm)
+// Copyright (C) 2015
+//
+// This file is distributed under the same license as the Scilab package.
+// =============================================================================
+
+// <-- TEST WITH GRAPHIC -->
+
+// <-- Non-regression test for bug 13733 -->
+//
+// <-- Bugzilla URL -->
+// http://bugzilla.scilab.org/show_bug.cgi?id=13733
+//
+// <-- Short Description -->
+// Optional arguments did not work properly. e.g colorbar(1,10,fmt="%d").
+
+colorbar(1,10,fmt="%d");
+colorbar(1,10,[1,10],fmt="%d");
+colorbar(1,10,fmt="%d", colminmax=[1,10]);
\ No newline at end of file