octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #39243] patch - matlab compatibility - changin


From: Nicholas Jankowski
Subject: [Octave-bug-tracker] [bug #39243] patch - matlab compatibility - changing xdata length produces dimension warning
Date: Mon, 29 Nov 2021 17:06:23 -0500 (EST)
User-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36

Update of bug #39243 (project octave):

                Severity:              3 - Normal => 2 - Minor              
                Priority:              5 - Normal => 3 - Low                
                 Summary: patch {x,y,z,c}data properties are not independent
=> patch - matlab compatibility - changing xdata length produces dimension
warning

    _______________________________________________________

Follow-up Comment #17:

the current warning is: 

warning: opengl_renderer: x/y/zdata must have the same dimensions.  Not
rendering.
warning: called from
    __opengl_print__ at line 204 column 9
    print at line 757 column 16


__opengl_print__ line 204 calls:

 drawnow (gl2ps_device{n}, ['| "' pipeline{n} '"']);


drawnow being a built-in/compiled function inside
libinterp/corefcn/graphics.cc, that's as far as I could step.  A quick search,
however, shows blocks of code with the same warning msg:

line 9721:

void
patch::properties::update_fvc (void)
{
  if (updating_patch_data)
    return;

  Matrix xd = get_xdata ().matrix_value ();
  Matrix yd = get_ydata ().matrix_value ();
  Matrix zd = get_zdata ().matrix_value ();
  NDArray cd = get_cdata ().array_value ();

  m_bad_data_msg = "";
  if (xd.dims () != yd.dims ()
      || (xd.dims () != zd.dims () && ! zd.isempty ()))
    {
      m_bad_data_msg = "x/y/zdata must have the same dimensions";
      return;
    }



and line 10306:

void
scatter::properties::update_data (void)
{
  Matrix xd = get_xdata ().matrix_value ();
  Matrix yd = get_ydata ().matrix_value ();
  Matrix zd = get_zdata ().matrix_value ();
  Matrix cd = get_cdata ().matrix_value ();
  Matrix sd = get_sizedata ().matrix_value ();

  m_bad_data_msg = "";
  if (xd.dims () != yd.dims ()
      || (xd.dims () != zd.dims () && ! zd.isempty ()))
    {
      m_bad_data_msg = "x/y/zdata must have the same dimensions";
      return;
    }


I assume we're following the patch codeblock, but didn't see a "Not
rendering." though, so that must be appended elsewhere. 

none of this is dependent on the print command or pdf output given in comment
#8.  a simpler test script is:


xdata = cosd (0:60:360);
ydata = sind (0:60:360);
h = patch (xdata, ydata, 'b', 'marker', 's'); %% draws hexagon
set (h, 'xdata', xdata(1:end-1)); %% hexagon minus duplicated last pt
set (h, 'xdata', xdata(1:end-2)); %% draws with only 5 points
set (h, 'xdata', xdata(1:end-3)); %% draws with only 4 points


In Matlab 2021, each of the 'set' lines will trigger a redraw of the figure
with the appropriate # of points (indicating set knows to trim ydata to the
matching length), whereas Octave gives you the x/y/zdata warning and won't
redraw. Noting that both error if you attempt to:

Matlab:

h = patch (xdata(1:end-1), ydata, 'b', 'marker', 's');

Error using patch
Vectors must be the same length.


Octave:

>> h = patch (xdata(1:end-1), ydata, 'b', 'marker', 's');
>> warning: opengl_renderer: x/y/zdata must have the same dimensions.  Not
rendering.
warning: opengl_renderer: x/y/zdata must have the same dimensions.  Not
rendering.
warning: opengl_renderer: x/y/zdata must have the same dimensions.  Not
rendering.

(not sure why the duplicated warnings)

noting that the original bug is seemingly corrected but that the comment #15
warnings persist, retitling the report accordingly.  Also, noting the age of
the report and the fact that this can be avoided by setting both x and y data
to the same limit, lowering severity/priority.  



    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?39243>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]