help-octave
[Top][All Lists]
Advanced

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

Re: Questions on format options and axes tick scaling


From: Ben Abbott
Subject: Re: Questions on format options and axes tick scaling
Date: Wed, 19 Oct 2011 18:12:59 -0400

On Oct 19, 2011, at 4:54 PM, fg wrote:

> Hi,
> 
> the  http://imageshack.us/photo/my-images/41/skalierung.png/ image  shows
> what I want.
> The CDF of the Weibull distribution is given by P_f = 1-exp(-(s/s_0)^m) and
> is linearized with respect to s as ln(ln(1/(1-P_f))) = m*ln(s/s_0).
> 
> The inner axes of the graph show this linearized form. What I want ist the
> outer axes made by octave so that one can read the failure probability in
> percent without calculating it manually from the inner axes.
> The x-axis is a simple log-style axis.
> 
> For the ticks I need on the y-axis octave has to calculate
> 100*(1-1/exp(exp(y))) with y being a value from the inner y-axis.
> Examples: y=0 -> 63,2% and -4 -> 1.8%.
> 
> I hope I could clear things up a little bit.
> 
> So is this possible?

It is a bit confusing to understand what the values of the x/y axes need to be, 
but I think I can demonstrate enough that you can infer what you need to do.

s = 0.05:0.001:2;
s_0 = 1;
m = 2;
P_f = 1 - exp (-(s / s_0) .^ m);

ln = @(x) log (x);
x = m * ln (s / s_0);
y = ln (ln (1 ./ (1 - P_f)));

y2 = 100 * (1 - 1 ./ exp (exp (y)));

ytick = [0.01 0.1 0.2 0.3 0.5 0.7 0.9];
yticklabel = strsplit (sprintf ("%d%%\n", round (100*ytick)), "\n", true);
ytick = ln (ln (1 ./ (1 - ytick)));

figure (1)
clf
plot (x, y);
set (gca, "ytick", ytick, "yticklabel", yticklabel)

Ben





reply via email to

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