bugGNU Octave - Bugs: bug #31542, semilogy and axis tight

 
 

bug #31542: semilogy and axis tight

Submitted by:  None
Submitted on:  Thu 04 Nov 2010 11:42:11 AM UTC  
 
Category: NoneSeverity: 3 - Normal
Priority: 5 - NormalItem Group: None
Status: FixedAssigned to: Ben Abbott <bpabbott>
Originator Name: moritzOriginator Email: -unavailable-
Open/Closed: ClosedRelease: 3.2.4
Operating System: Microsoft Windows

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

(Jump to the original submission Jump to the original submission)

Mon 08 Nov 2010 12:48:33 AM UTC, comment #9:

I pushed the changeset with your suggestion.

http://hg.savannah.gnu.org/hgweb/octave/rev/6c8791cb35b1

Ben Abbott <bpabbott>
Project MemberIn charge of this item.
Sun 07 Nov 2010 06:36:11 PM UTC, comment #8:

The new changeset works for me so commit it whenever you want.

One question, would it be simpler to use the same solution in both _go_draw_axes_.m and axis.m? In _go_draw_axes_.m you handle the problem by replacing invalid data with NaNs. In axis.m you keep the problem data, but define new min/max functions that work around the data. Why not use the same solution and replace invalid data with NaNs in axis.m?

I modified your changeset just to see if it would work in this way and it does. Take a look at the attached file.

(file #21956)

Rik <rik5>
Project Administrator
Sat 06 Nov 2010 02:04:06 AM UTC, comment #7:

I missed the case where there is only a single line. I've attached an updated changeset.

(file #21940)

Ben Abbott <bpabbott>
Project MemberIn charge of this item.
Sat 06 Nov 2010 12:30:48 AM UTC, comment #6:

Even with your patch, I still have a problem using the original example.

The code blanks the figure window with either backend.

Rik <rik5>
Project Administrator
Fri 05 Nov 2010 04:02:50 PM UTC, comment #5:

Changeset has been attached (not pushed yet).

This changeset will not apply cleanly to 3.2.4. It is intended for the developers sources.

(file #21935)

Ben Abbott <bpabbott>
Project MemberIn charge of this item.
Fri 05 Nov 2010 03:50:36 PM UTC, comment #4:

I have a local patch that is working for me. I'll do some more tests and push later.

Ben Abbott <bpabbott>
Project MemberIn charge of this item.
Fri 05 Nov 2010 02:52:11 PM UTC, comment #3:

I'm running the developer's sources. When I try one of the examples below, the resulting figure window is blank.

Matlab's figure is not blank. I've attached a pdf.

(file #21934)

Ben Abbott <bpabbott>
Project MemberIn charge of this item.
Fri 05 Nov 2010 07:03:08 AM UTC, comment #2:

Thanks for your fast response.

1.) Yes, of course, negative numbers cannot show up. But I would personally expect that they are just omitted and axis tight only uses the values of the existing real numbers.

At least this is the behavior in Matlab.

2.) Also, axis tight can deal with NaNs, the following code snipplet works:

3.) The same warning is thrown in both cases I mentioned in the previous post. However, I personally would expect an exception/error if axis tight prevents the figure from plotting/showing up.

Thanks again and cheers, Moti

Anonymous
Thu 04 Nov 2010 09:30:59 PM UTC, comment #1:

How is this an error? The logarithm of a negative value is a complex number which can't be displayed on a 2-D graph. The automatic axis sizing code therefore restricts the plot to only positive values. When I run your semilogy command I get the following "warning: axis: omitting nonpositive data in log plot".

axis("tight") tries to set the axes to the min/max values of the dataset, but it can't do that if the range isn't made from real numbers.

Rik <rik5>
Project Administrator
Thu 04 Nov 2010 11:42:11 AM UTC, original submission:

axis tight prevents a semilogy with negative number in it from showing up:

On the other hand the same command without the axis tight does the job.

+vebatim+
octave:1> semilogy(sin(1:1000));
-verbatim-

I am using octave 3.2.4, configured for i686-pc-mingw32 together with the wxt plugin.

Anonymous

 

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

Attach File(s):
   
   
Comment:
   

Attached Files
file #21956:  patch.axis_tight added by rik5 (1KiB - application/octet-stream)
file #21934:  matlab.pdf added by bpabbott (4KiB - application/pdf)

 

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 rik5 (Posted a comment)
  •  

    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 9 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Mon 08 Nov 2010 12:48:33 AM UTCbpabbottStatusPatch Submitted=>Fixed
      Open/ClosedOpen=>Closed
    Sun 07 Nov 2010 06:36:11 PM UTCrik5Attached File-=>Added patch.axis_tight, #21956
    Sat 06 Nov 2010 02:04:06 AM UTCbpabbottAttached File-=>Added changeset.patch, #21940
    Fri 05 Nov 2010 04:02:50 PM UTCbpabbottAttached File-=>Added changeset.patch, #21935
      StatusNeed Info=>Patch Submitted
    Fri 05 Nov 2010 03:50:36 PM UTCbpabbottAssigned toNone=>bpabbott
    Fri 05 Nov 2010 02:52:11 PM UTCbpabbottAttached File-=>Added matlab.pdf, #21934
    Thu 04 Nov 2010 09:30:59 PM UTCrik5StatusNone=>Need Info

    Back to the top


    Powered by Savane 3.1-cleanup1