Y-range ignored by fplot

Jaroslav Hajek highegg at gmail.com
Fri Oct 3 07:35:17 CDT 2008


On Wed, Sep 24, 2008 at 10:49 PM, John W. Eaton <jwe at bevo.che.wisc.edu> wrote:
> On 24-Sep-2008, Torquil Macdonald Sørensen wrote:
>
> | Bug report for Octave 3.0.1 configured for i486-pc-linux-gnu
> |
> | Description:
> | -----------
> |
> |    The y limits is ignored by fplot. As I understand the manual, the
> | correct usage is fplot("f",[0,1,0,1]), where the last two of the numbers
> | is the y-range of the plot. When only specifying the x-range it works
> | ok, i.e. fplot("fn",[0,1]). But varying the y-range has no effect.
>
> Please try the following patch.  It is relative to the current
> sources, but I think it should also apply to the 3.0.x branch.
>

Applied.


> Thanks,
>
> jwe
>
>
> # HG changeset patch
> # User John W. Eaton <jwe at octave.org>
> # Date 1222289309 14400
> # Node ID 7ef5b1b4e0298d15ff49963f4dde716e6ff5b485
> # Parent  01fac748b680e825eb1416b0ac1d617ce56aa4ba
> fplot.m: call axis after plot
>
> diff --git a/scripts/ChangeLog b/scripts/ChangeLog
> --- a/scripts/ChangeLog
> +++ b/scripts/ChangeLog
> @@ -1,3 +1,7 @@
> +2008-09-24  John W. Eaton  <jwe at octave.org>
> +
> +       * plot/fplot.m: Call axis after calling plot.
> +
>  2008-09-24  Soren Hauberg  <hauberg at gmail.com>
>
>        * image/imfinfo.m: New function.
> diff --git a/scripts/plot/fplot.m b/scripts/plot/fplot.m
> --- a/scripts/plot/fplot.m
> +++ b/scripts/plot/fplot.m
> @@ -98,15 +98,16 @@
>     y = feval (fn, x);
>   endif
>
> -  if (length (limits) > 2)
> -    axis (limits);
> -  endif
> -
>   if (have_linespec)
>     plot (x, y, linespec);
>   else
>     plot (x, y);
>   endif
> +
> +  if (length (limits) > 2)
> +    axis (limits);
> +  endif
> +
>   if (isvector(y))
>     legend (nam);
>   else
>
> _______________________________________________
> Bug-octave mailing list
> Bug-octave at octave.org
> https://www-old.cae.wisc.edu/mailman/listinfo/bug-octave
>
>



-- 
RNDr. Jaroslav Hajek
computing expert
Aeronautical Research and Test Institute (VZLU)
Prague, Czech Republic
url: www.highegg.matfyz.cz



More information about the Bug-octave mailing list