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

 
 

bug #31542: semilogy and axis tight

Submitter:  None
Submitted:  Thu 04 Nov 2010 11:42:11 AM UTC
   
 
Category:  None Severity:  3 - Normal
Priority:  5 - Normal Item Group:  None
Status:  Fixed Assigned to:  bpabbott
Originator Name:  moritz Originator Email:  -email is unavailable-
Open/Closed:  * Closed Release:  * 3.2.4
Operating System:  * Microsoft Windows Fixed Release:  None
Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

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>
Group Member
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>
Group 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>
Group Member
Sat 06 Nov 2010 12:30:48 AM UTC, comment #6: 

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


semilogy (sin (1:1000));
axis ("tight")


The code blanks the figure window with either backend.

Rik <rik5>
Group 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>
Group Member
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>
Group Member
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>
Group Member
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:


octave:1> y = sin(1:1000);
octave:2> y(y<=0) = NaN;
octave:3> semilogy(y); axis tight;


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>
Group 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:


octave:1> semilogy(sin(1:1000)); axis tight;


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 Files:
   
   
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
  • -email is unavailable- added by bpabbott (Updated the item)
  • -email is unavailable- added by rik5 (Posted a comment)
  •  

    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
    2010-11-08 bpabbott StatusPatch Submitted Fixed
        Open/ClosedOpen Closed
    2010-11-07 rik5 Attached File- Added patch.axis_tight, #21956
    2010-11-06 bpabbott Attached File- Added changeset.patch, #21940
    2010-11-05 bpabbott Attached File- Added changeset.patch, #21935
        StatusNeed Info Patch Submitted
    2010-11-05 bpabbott Assigned toNone bpabbott
    2010-11-05 bpabbott Attached File- Added matlab.pdf, #21934
    2010-11-04 rik5 StatusNone Need Info

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code