From: Samuel GOUGEON Date: Thu, 22 Oct 2020 17:25:22 +0000 (+0200) Subject: * Bug 16561 fixed: histplot(-10:0.2:10, 6) warning & error removed X-Git-Tag: 6.1.1~91 X-Git-Url: http://gitweb.scilab.org/?p=scilab.git;a=commitdiff_plain;h=9f7ed1629779dd2431a498c72d930a5de1995293 * Bug 16561 fixed: histplot(-10:0.2:10, 6) warning & error removed http://bugzilla.scilab.org/16561 Change-Id: Ia6d282bf0ef450d2c52f8380b4a792f1da13f08a --- diff --git a/scilab/CHANGES.md b/scilab/CHANGES.md index 4cf0f0c..2575306 100644 --- a/scilab/CHANGES.md +++ b/scilab/CHANGES.md @@ -410,8 +410,10 @@ Bug Fixes * [#16551](https://bugzilla.scilab.org/16551): `num2cell` returned {} for any input array of empty strings. * [#16552](https://bugzilla.scilab.org/16552): `mfile2sci`: conversion of `ispc` and `isunix` still used `MSDOS` removed far ago. Conversion of `ismac` was missing. Conversion of `exist` missed using `mtlb_exist`. Conversion of `dos` yielded some "operation +" warnings. Unit tests for the conversion of `cd`, `dir` and `ferror` overwrote some Scilab reserved keywords. Conversion of `return` yielded `mtlb(resume)`. * [#16553](https://bugzilla.scilab.org/16553): `unique(["" ""])` returned `["" ""]`. +<<<<<<< HEAD * [#16557](https://bugzilla.scilab.org/16557): `macr2tree` + `tree2code` translated `e={2}` into `"e=1"` and `e={2,"ab"}` into `"e=[2,"ab"]"`. * [#16559](https://bugzilla.scilab.org/16553): `isempty(A)` was true for sparse matrix of dimension 2^16 or larger. +* [#16561](https://bugzilla.scilab.org/16561): `histplot(-10:0.2:10, 2)` yielded a warning from `histc` and an error. * [#16565](https://bugzilla.scilab.org/16565): `edit(user_defined_function)` corrupted the original code. * [#16567](https://bugzilla.scilab.org/16567): `mfile2sci` did not support Matlab block-comments %{ ..%}. * [#16568](https://bugzilla.scilab.org/16568): The operator `**` was undocumented. @@ -438,6 +440,8 @@ Bug Fixes * [#16639](https://bugzilla.scilab.org/16639): `atomsInstall` and `atomsRemove` did not update the Toolboxes menu. * [#16644](https://bugzilla.scilab.org/16644): `input("message:")` yielded a wrong error message about `mprintf` in case of non-interpretable input. * [#16654](https://bugzilla.scilab.org/16654): `interp` was leaking memory. +======= +>>>>>>> 85449b28051 (* Bug 16561 fixed: histplot(-10:0.2:10, 6) warning & error removed) ### Bugs fixed in 6.1.0: diff --git a/scilab/modules/graphics/macros/histplot.sci b/scilab/modules/graphics/macros/histplot.sci index 42b6606..464f4c9 100644 --- a/scilab/modules/graphics/macros/histplot.sci +++ b/scilab/modules/graphics/macros/histplot.sci @@ -96,6 +96,7 @@ function [y, ind] = histplot(n,data,style,strf,leg,rect,nax,logflag,frameflag,ax else tmp = "counts" end + from_histplot = %t // helps detecting/supporting former syntaxes in histc() [y, tmp, tmp, ind] = histc(data, n, tmp); if length(n) == 1 then // The number of classes is provided diff --git a/scilab/modules/graphics/tests/nonreg_tests/bug_16561.dia.ref b/scilab/modules/graphics/tests/nonreg_tests/bug_16561.dia.ref new file mode 100644 index 0000000..0aa7c9f --- /dev/null +++ b/scilab/modules/graphics/tests/nonreg_tests/bug_16561.dia.ref @@ -0,0 +1,15 @@ +// ============================================================================= +// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab +// Copyright (C) 2020 - Samuel GOUGEON +// +// This file is distributed under the same license as the Scilab package. +// ============================================================================= +// <-- TEST WITH GRAPHIC --> +// <-- Non-regression test for bug 16561 --> +// +// <-- Bugzilla URL --> +// http://bugzilla.scilab.org/16561 +// +// <-- Short Description --> +// histplot(linspace(-10,10,100), rand(5)) yielded an error +assert_checkequal(execstr("histplot(linspace(-10,10,100), rand(5))","errcatch"), 0); diff --git a/scilab/modules/graphics/tests/nonreg_tests/bug_16561.tst b/scilab/modules/graphics/tests/nonreg_tests/bug_16561.tst new file mode 100644 index 0000000..dff1ccb --- /dev/null +++ b/scilab/modules/graphics/tests/nonreg_tests/bug_16561.tst @@ -0,0 +1,18 @@ +// ============================================================================= +// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab +// Copyright (C) 2020 - Samuel GOUGEON +// +// This file is distributed under the same license as the Scilab package. +// ============================================================================= + +// <-- TEST WITH GRAPHIC --> + +// <-- Non-regression test for bug 16561 --> +// +// <-- Bugzilla URL --> +// http://bugzilla.scilab.org/16561 +// +// <-- Short Description --> +// histplot(linspace(-10,10,100), rand(5)) yielded an error + +assert_checkequal(execstr("histplot(linspace(-10,10,100), rand(5))","errcatch"), 0); diff --git a/scilab/modules/statistics/macros/histc.sci b/scilab/modules/statistics/macros/histc.sci index 5c8b758..3cd874a 100644 --- a/scilab/modules/statistics/macros/histc.sci +++ b/scilab/modules/statistics/macros/histc.sci @@ -70,8 +70,9 @@ function [heights, jokers, binsOut, ind] = histc(data, bins, options) // ------------------------- mode55 = %f // Check for Scilab 5.5 back-compatibility - if (isdef("data","l") & isdef("bins", "l") & type(bins)>0) & .. - size(data,"*")< size(bins,"*") & or(type(data)==[1 8]) & type(bins)~=10 + if ~isdef("from_histplot") & isdef("data","l") & isdef("bins", "l") & .. + type(bins)>0 & size(data,"*")< size(bins,"*") & .. + or(type(data)==[1 8]) & type(bins)~=10 msg = _("%s: data are now expected in argument #1 => arguments #1 and #2 switched\n") warning(msprintf(msg, fname)) mode55 = %t