bugGNU Octave - Bugs: bug #30950, wrong axes ranges in imagesc(x,y,z)

 
 

bug #30950: wrong axes ranges in imagesc(x,y,z)

Submitter:  Petr Mikulik <mikulik>
Submitted:  Thu 02 Sep 2010 03:39:26 PM UTC
   
 
Category:  Interpreter Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Fixed Assigned to:  bpabbott
Originator Name:  Open/Closed:  * Closed
Release:  * dev Operating System:  * GNU/Linux
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Fri 03 Sep 2010 12:06:54 PM UTC, comment #3: 

I've pushed the changeset.

Regarding 3.2.x, that series is no longer being maintained.

I'm closing this ticket, but it will remained unlocked if a follow up is needed.

Thanks

Ben Abbott <bpabbott>
Group Member
Fri 03 Sep 2010 09:10:03 AM UTC, comment #2: 

The patch works perfectly, thanks!

It even fixes the bug in Octave 3.2.x:
       n=3; imagesc(1:n,1:n,1./hilb(n))
(well visible for small values of n) which displays only half-pixels on the boundary.
Could you commit this fix to 3.2.x as well?


Petr Mikulik <mikulik>
Fri 03 Sep 2010 01:19:59 AM UTC, comment #1: 

I've experimented with Matlab and found that the axis limits should be ...

  c = size (z, 2);
  xlim = 0.5 ((x(end) - x(1)) c / (c - 1) * [-1, 1] + (x(1) + x(end)));

  r = size (z, 1);
  ylim = 0.5 ((y(end) - y(1)) r / (r - 1) * [-1, 1] + (y(1) + y(end)));

This works for both equi-space x/y vectors and for sorted random x/y vectors.

I've attached a changeset.

Testing would be appreciated.

(file #21378)

Ben Abbott <bpabbott>
Group Member
Thu 02 Sep 2010 03:39:26 PM UTC, original submission:  

The 3.3.x and the development series of Octave adds plenty of empty (white) space around the data image. Octave 3.2 works correctly (tight boundary, no white space).

Commands to demonstrate this:

z=1./hilb(9);
x=-0.6:0.2:0.6;
y=-2.6:0.4:2.6;
imagesc(x,y,z);

or

z=1./hilb(9);
x=-3:3;
y=-3:3;
imagesc(x,y,z);

If the x and y limits are larger than +-4, then figure is OK:
z=1./hilb(9);
x=-4:4;
y=-4:4;
imagesc(x,y,z);

Petr Mikulik <mikulik>

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #21378:  changeset.patch added by bpabbott (1KiB - application/octet-stream - 1st changeset)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by bpabbott (Updated the item)
  • -email is unavailable- added by mikulik (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 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2010-09-03 bpabbott StatusPatch Submitted Fixed
        Open/ClosedOpen Closed
    2010-09-03 bpabbott Attached File- Added changeset.patch, #21378
        StatusNone Patch Submitted
        Assigned toNone bpabbott

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code