bugGNU Octave - Bugs: bug #34656, default axis limits for log plots

 
 

bug #34656: default axis limits for log plots

Submitter:  John W. Eaton <jwe>
Submitted:  Tue 25 Oct 2011 11:46:10 PM UTC
   
 
Category:  Plotting Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Fixed Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * dev Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Mon 31 Oct 2011 11:46:35 PM UTC, comment #5: 

Looks like jwe's patch below fixed this.

http://hg.savannah.gnu.org/hgweb/octave/rev/1e81e2e30af3

I assume it is ok to close?

Ben Abbott <bpabbott>
Group Member
Wed 26 Oct 2011 11:30:04 PM UTC, comment #4: 

I took a quick look. The gnuplot plotstream has the ranges below.


set xrange [1.000000000000000e-01:1.000000000000000e+00] noreverse;
set yrange [1.000000000000000e-01:1.000000000000000e+00] noreverse;


If I change the result to the ranges below, the lower limits are displayed correctly.


set xrange [0.999999999999999e-01:1.000000000000001e+00] noreverse;
set yrange [0.999999999999999e-01:1.000000000000001e+00] noreverse;


Looks like a round-off problem. Over the years, I've seen similar problems with Matlab. I normally fix it by doing something like below.


xlim = xlim .* [1-eps, 1+eps];
ylim = ylim .* [1-eps, 1+eps];
zlim = zlim .* [1-eps, 1+eps];


Should we do that in this case? Should the change be in graphics.cc or in _go_draw_axes_.m?

If the former, can you take a look at how to best do that?

Ben Abbott <bpabbott>
Group Member
Wed 26 Oct 2011 11:03:38 PM UTC, comment #3: 

FWIW Matlab has;

xlim = [1, 10^0.3[
xtick = 10.^[0 0.1 0.2 0.3];
ylim = [0.1 1];
ytick = [0.1 1];

I'll be on vacation from tomorrow till Tuesday. If gnuplot needs to be fixed quickly, it is unlikely I'll be able to take a look (although there is a small chance I'll get to it this evening).


Ben Abbott <bpabbott>
Group Member
Wed 26 Oct 2011 09:52:56 PM UTC, comment #2: 

I checked in the following change:

http://hg.savannah.gnu.org/hgweb/octave/rev/1e81e2e30af3

We might be able to eliminate the max_neg variable in graphics.cc now, but I didn't do that yet.

I notice that with gnuplot,


loglog ([0, -Inf])


does not display a lower limit on the Y axis.  It is there with OpenGL+FLTK.

John W. Eaton <jwe>
Group administrator
Wed 26 Oct 2011 08:27:23 PM UTC, comment #1: 

I noticed this a few weeks back and forgot to file a report. Matlab's ylim for this is [0.1 1].

I spent a few hours looking over the code, but was unable to see how this should be done. It looked as if the default values for the ylim/xlim/zlim properties need to depend upon the xscale/yscale/zscale properties. Perhaps a listener is needed, but I don't know how to do that.

Ben Abbott <bpabbott>
Group Member
Tue 25 Oct 2011 11:46:10 PM UTC, original submission:  

Executing the following


figure
set (gca, 'yscale', 'log')


doesn't work with either gnuplot or OpenGL+FLTK grahpics.  With gnuplot, I see an error from gnuplot:


octave:1> set (gca, 'yscale', 'log')
octave:2>          line 2: y range must be greater than 0 for log scale


and with OpenGL+FLTK, I see an empty figure window.  I think axes should be displayed and default limits should be set appropriately for the axes with log scales, for example to [.1, 1] (whatever is compatible with Matlab).

John W. Eaton <jwe>
Group administrator

 

(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 bpabbott (Posted a comment)
  • -email is unavailable- added by jwe (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 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2011-10-31 bpabbott StatusNone Fixed
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code