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

 
 

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

Submitted by:  Petr Mikulik <mikulik>
Submitted on:  Thu 02 Sep 2010 03:39:26 PM UTC  
 
Category: InterpreterSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Incorrect Result
Status: FixedAssigned to: Ben Abbott <bpabbott>
Originator Name: Open/Closed: Closed
Release: devOperating System: GNU/Linux

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

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>
Project MemberIn charge of this item.
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>
Project MemberIn charge of this item.
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 File(s):
   
   
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
  • -unavailable- added by bpabbott (Updated the item)
  • -unavailable- added by mikulik (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 5 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Fri 03 Sep 2010 12:06:54 PM UTCbpabbottStatusPatch Submitted=>Fixed
      Open/ClosedOpen=>Closed
    Fri 03 Sep 2010 01:19:59 AM UTCbpabbottAttached File-=>Added changeset.patch, #21378
      StatusNone=>Patch Submitted
      Assigned toNone=>bpabbott

    Back to the top


    Powered by Savane 3.1-cleanup1