bugGNU Octave - Bugs: bug #45292, image: unclear warning messages...

 
 

bug #45292: image: unclear warning messages when X or Y are not vectors

Submitter:  Alexander Klein <matalex>
Submitted:  Wed 10 Jun 2015 11:03:36 AM UTC
   
 
Category:  Octave Function Severity:  2 - Minor
Priority:  5 - Normal Item Group:  Documentation
Status:  Confirmed Assigned to:  None
Originator Name:  Open/Closed:  * Open
Release:  * dev Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Wed 10 Jun 2015 03:15:42 PM UTC, comment #4: 

I think that the whole situation arose because I worked with 3D-graphics, and in the help text, functions that take meshgrid data as well as all imageā€¦-functions invariably call their arguments X and Y.

Throwing an error would probably be the best thing to do here, at least in my opinion.

Alexander Klein <matalex>
Wed 10 Jun 2015 02:30:09 PM UTC, comment #3: 

Ok, thanks. Confirmed on Linux, dropping severity etc. Categorizing as documentation because this seems to be about the docstring and/or warning messages.

The image plot does show the correct axes labels for the min and max of the supplied X and Y, so the end behavior is not incorrect, only the warning messages may be misleading in this instance.

The image function is not expecting X and Y to be matrices. The plot will only use the extrema of each of them as the min and max of the linear axis labeling. Since you did not pass in a linear vector, it displays the non-linear warning.

It could detect whether X and Y are vectors and error if they are not, instead of trying to convert them into vectors and use them, possibly incorrectly. I think that's more appropriate than trying to make the block work with matrices. But wide open to suggestions as to how best to address this.

As a user what would best explain to you that it's incorrect to try to pass the output of meshgrid into image?

Mike Miller <mtmiller>
Group Member
Wed 10 Jun 2015 02:09:34 PM UTC, comment #2: 

Sure, here's an example:


[X,Y]=meshgrid(1:8,1:9);
image(X,Y,256*randn(5));


This works without problems in 3.6.4 on OSX.

Alexander Klein <matalex>
Wed 10 Jun 2015 02:00:42 PM UTC, comment #1: 

Thanks for your bug report. Can you provide an example array and command that shows the error you are reporting? E.g. the following simple usage works for me in 3.8.2 or 4.0.0.:


>> image (1:16, 1:16, 255 * rand (16));


The block of code you mention is trying to ensure that X and Y are linear vectors, so I'm not sure what type of X and Y you are passing in, maybe further checks need to be added to the function to catch other types of invalid arguments.

Mike Miller <mtmiller>
Group Member
Wed 10 Jun 2015 11:03:36 AM UTC, original submission:  

When I tried to use the "image" command to display a matrix with Gnuplot, I got the following two warnings:

1. operator -: automatic broadcasting operation applied, (this was shown twice)
2. image: non-linear X, Y data is ignored. IMG will be shown for linear mapping.

I haven't investigated the further, but the latter is obviously incorrect for my set of coordinates, and it turned out that the whole process of determining whether the input coordinates are linear is probably confused by meshgrid matrices being used as an input to image.m, and as a consequence, numel returning an unexpected result in the original version of lines 166 and 169.

The whole problem could be patched away by the following changes to image.m, but may warrant a bit of further investigation by someone who is more familiar with the respective code:


169c
      dymean = (max (y) - min (y)) / (rows (y) - 1);
.
166c
      dxmean = (max (x) - min (x)) / (rows (x) - 1);
.


Alexander Klein <matalex>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by matalex (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 9 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2019-03-01 mtmiller Carbon-CopyRemoved 80942 -
    2015-06-10 mtmiller SummaryStrange issue with image.m and Gnuplot image: unclear warning messages when X or Y are not vectors
    2015-06-10 mtmiller Release3.8.2 dev
        Operating SystemBSD Any
    2015-06-10 mtmiller CategoryPlotting with gnuplot Octave Function
        Severity3 - Normal 2 - Minor
        Item GroupRegression Documentation
        StatusNeed Info Confirmed
    2015-06-10 mtmiller StatusNone Need Info

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code