octave-bug-tracker
[Top][All Lists]
Advanced

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

[Octave-bug-tracker] [bug #39938] make qqplot ML compatible


From: Muhali
Subject: [Octave-bug-tracker] [bug #39938] make qqplot ML compatible
Date: Sat, 07 Sep 2013 15:25:13 +0000
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:23.0) Gecko/20100101 Firefox/23.0

Follow-up Comment #3, bug #39938 (project octave):

To be fully compatible to tex the q_label needs to be fixed, so the patch
reads


--- /a/qqplot.m
+++ /b/qqplot.m
@@ -18,8 +18,9 @@
 
 ## -*- texinfo -*-
 ## @deftypefn  {Function File} address@hidden, @var{s}] =} qqplot (@var{x})
+## @deftypefnx {Function File} address@hidden, @var{s}] =} qqplot (@var{x},
@var{y})
 ## @deftypefnx {Function File} address@hidden, @var{s}] =} qqplot (@var{x},
@var{dist})
-## @deftypefnx {Function File} address@hidden, @var{s}] =} qqplot (@var{x},
@var{dist}, @var{params})
+## @deftypefnx {Function File} address@hidden, @var{s}] =} qqplot (@var{x},
@var{y}, @var{params})
 ## @deftypefnx {Function File} {} qqplot (@dots{})
 ## Perform a QQ-plot (quantile plot).
 ##
@@ -29,6 +30,9 @@
 ## largest element of x versus abscissa @var{q}(@var{i}f) = G((@var{i} -
 ## 0.5)/@var{n}).
 ##
+## If the second argument is a vector @var{y} the empirical CDF of @var{y}
+## is used as @var{dist}.
+##
 ## If the sample comes from F, except for a transformation of location
 ## and scale, the pairs will approximately follow a straight line.
 ##
@@ -65,7 +69,13 @@
   if (nargin == 1)
     f = @stdnormal_inv;
   else
-    if (   exist (invname = sprintf ("%sinv", dist))
+    if ( isvector(dist) )
+       if ( exist("empirical_inv") == 2 )
+         f = @(y) empirical_inv(y, dist) ;
+       else
+         f = @(y) empiricalinv(y, dist) ;
+       endif
+    elseif(   exist (invname = sprintf ("%sinv", dist))
         || exist (invname = sprintf ("%s_inv", dist)))
       f = str2func (invname);
     else
@@ -92,6 +102,7 @@
 
   if (nargout == 0)
     plot (q, s);
+    q_label = strrep(q_label, "_", "\_") ;
     xlabel (q_label);
     ylabel ("sample points");
   endif


    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?39938>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

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