octave-maintainers
[Top][All Lists]
Advanced

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

Re: pareto function


From: David Bateman
Subject: Re: pareto function
Date: Fri, 30 Nov 2007 21:23:12 +0100
User-agent: Thunderbird 1.5.0.7 (X11/20060921)

John W. Eaton wrote:
> On 30-Nov-2007, David Bateman wrote:
> 
> | That is normal. If you set "hold on" it should work as you want, except
> | that the scales on the y-axis are completely different and the sin curve
> | is not visible.. Something like
> | 
> | x = -10:0.1:10;
> | pareto(rand(1,21),-10:1:10)
> | hold on
> | plot(x, sin(x));
> | 
> | should work,
> 
> OK, that does what I expect, but I wasn't trying to to overlay the
> sin(x) plot on the pareto plot.  Instead, I expect
> 
>   x = -10:0.1:10;
>   pareto(rand(1,21),-10:1:10)
> 
> to make a plot, and then because plot is a high-level plotting
> function that calls newplot, I expect
> 
>   plot(x, sin(x));
> 
> to completely replace the pareto plot with the normal sin wave plot
> (only).  Instead, I get the plot attached below.  I don't understand
> why that isn't happening.
> 

Because the pareto is plotted with plotyy and has two sets of coincident
axes and the sin curve is replacing the bar chart, but not the
cummulative density function of the pareto. The reason the axes are no
longer coincident is that as Octave doesn't have listener functions yet,
I couldn't get the set of axes to automatically adjust their size
relative to each and so forced their size with "set rmargin", etc. The
new plot is not flagged as part of a plotyy set of axes and so doesn't
get adjusted to the common size. Matlab does some similar things, though
not exactly this one as it has listener functions, but something like

x = -10:0.1:10;
pareto(rand(1,21),-10:1:10)
colorbar()

gives bad results in both Octave and Matlab.

D,


reply via email to

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