Mercurial > octave
view test/bug-45969.tst @ 32062:ada96a467a28
quiver: Improve plotting with non-float numeric inputs (bug #59695)
* scripts/plot/draw/private/__quiver__.m: Change firstnonnumeric check to look
for char instead of numeric to allow for logical inputs. Recast all inputs
up to firstnonnumeric as doubles. Check if firstnonnumeric element is 'off'
and if so set scale factor to 0 and increment firstnonnumeric.
* scripts/plot/draw/quiver.m: Update docstring to include scaling factor
option 'off'. Add BIST for int and logical input types.
* scripts/plot/draw/quiver3.m: Update docstring to include scaling factor
option 'off'. Add BISTs for too-few inputs.
* etc/NEWS.9.md: Appended details of changes to quiver note under General
Improvements and noted it also applies to quiver3.
author | Nicholas R. Jankowski <jankowski.nicholas@gmail.com> |
---|---|
date | Wed, 26 Apr 2023 17:18:50 -0400 |
parents | 9080316864bf |
children |
line wrap: on
line source
%!test <*45969> %! text_filename = tempname (); %! binary_filename = tempname (); %! a = 2; %! b = 10; %! c = 20; %! f1 = @ (f, x) f (x) + a; %! f2 = @ (y) f1 (@ (z) z^2 + b * y, y) + c; %! f2_arg = 5; %! save_default_options ("-text", "local"); %! unwind_protect %! save (text_filename, "f2"); %! save ("-binary", binary_filename, "f2"); %! text = load (text_filename); %! binary = load (binary_filename); %! assert (f2 (f2_arg), text.f2 (f2_arg)); %! assert (f2 (f2_arg), binary.f2 (f2_arg)); %! unwind_protect_cleanup %! unlink (text_filename); %! unlink (binary_filename); %! end_unwind_protect %!testif HAVE_HDF5 <*45969> %! hdf5_filename = tempname (); %! a = 2; %! b = 10; %! c = 20; %! f1 = @ (f, x) f (x) + a; %! f2 = @ (y) f1 (@ (z) z^2 + b * y, y) + c; %! f2_arg = 5; %! save_default_options ("-text", "local"); %! unwind_protect %! save ("-hdf5", hdf5_filename, "f2"); %! hdf5 = load (hdf5_filename); %! assert (f2 (f2_arg), hdf5.f2 (f2_arg)); %! unwind_protect_cleanup %! unlink (hdf5_filename); %! end_unwind_protect