Semilogy and zeros

John W. Eaton jwe at octave.org
Thu Jul 16 11:00:48 CDT 2009


On 16-Jul-2009, Ben Abbott wrote:

| On Jul 16, 2009, at 6:42 AM, Marco Caliari wrote:
| 
| > Dear maintainers,
| >
| > the following command
| >
| > semilogy([1e-16,0],'*')
| >
| > produces the warning
| > warning: axis: omitting nonpositive data in log plot
| >
| > and the corresponding plot in Octave 3.0.5, but an empty plot in
| > Octave 3.2.0. I think the old behaviour is the right one. I'm using
| > Gnuplot 4.2.5.
| >
| > Best regards,
| >
| > Marco
| 
| I don't see this warning in the m-file sources.

It comes from a function in graphics.cc.

| However, I have reproduced Marco's examples.

I checked in the following change.  It seems to fix the problem for
me.

  http://hg.savannah.gnu.org/hgweb/octave/rev/ac2617d4e30c

Note that the axis calcuation for log scale plots is still not quite
right when we have to discard negative data.  Currently, for example,
we discard the data for plotting, but we compute the axis limits
independently, on the full data.  Instead, I think we need to discard
the skipped data, then compute the axis limits.  But this seems like a
minor point, and will also require some significant restructuring, so
I have no plans to fix it.  However, I would consider a patch.

jwe


More information about the Bug-octave mailing list