octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: help with graphics


From: Michael Goffioul
Subject: Re: help with graphics
Date: Wed, 26 Oct 2011 08:48:46 +0100

On Wed, Oct 26, 2011 at 8:15 AM, John W. Eaton <address@hidden> wrote:
> +static bool
> +all_negative (const MArray<double>& m)
> +{
> +  bool retval = true;
> +  const double *data = m.data ();
> +  for (octave_idx_type i = 0; i < m.numel (); i++)
> +    {
> +      if (data[i] >= 0)
> +        {
> +          retval = false;
> +          break;
> +        }
> +    }
> +  return retval;
> +}

Wouldn't this better located in the MArray class, or more generally
somewhere in liboctave?

> @@ -248,6 +270,11 @@
>       for (int i = 0; i < n; i++)
>         dest[i] = log10(src[i]);
>     }
> +  void do_neg_scale (const double *src, double *dest, int n) const
> +    {
> +      for (int i = 0; i < n; i++)
> +        dest[i] = log10(-src[i]);
> +    }
>  };
>
>  class scaler
>
>
> The tick marks are displaced so that they are on top of the axis
> lines.  Not sure yet why that is happening.  I'll take a look at it
> later.  First I need to get some sleep...

This is probably because the new scaler flips the axis, so after
scaling the min and max values are swapped. You might want to try to
re-flips after log-scaling, like:

      dest[i] = -log10(-src[i]);

Michael.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]