From octave-graphics-request at bevo dot che dot wisc dot edu Fri Sep 26 22:11:32 2003 Subject: Re: Probability scale From: Phil Reardon To: "John W. Eaton" Cc: octave-graphics at bevo dot che dot wisc dot edu Date: Fri, 26 Sep 2003 21:19:16 -0600 On Fri, 26 Sep 2003 19:45:10 -0500 "John W. Eaton" wrote: > On 26-Sep-2003, Phi Reardon wrote: > > | It seems to me (correct me if I am wrong) that octave can plot on > | linear or log scales, but not probability scales. This would not be > | too hard to implement, it seems to me, but is not a current octave > | (or gnuplot) capability. If it were in place, then log-probability > | graphs of distributions like the log-normal distribution would be > | easy. Since this is a common sort of distribution, and even a > | common sort of graph paper, how about it? > > OK, write it up and send in a patch. > > If there is something similar in Matlab, it would probably help to > have a compatible interface. > > jwe > A patch is probably outside my skillset, but here is a little routine that locates the tic marks. I hope it will inspire someone else to look at implementing it in octave/gnuplot. function ans = pinv(y) # probinv calculates the inverse of the normal cumulative distribution function ans = erfinv(y/50.0 - 1.0); # printf("y=%f, ans=%e\n",y,ans); endfunction tics = [0.1;0.2;0.3;0.4;0.5;0.6;0.7;0.8;0.9;1.0;2.0;3.0;4.0;5.0;6.0;7.0;8.0;9.0;10.0;20.0;30.0;40.0;50.0;60.0;70.0;80.0;90.0;95.0;99.0;99.9]; L=15.0 #length of the scale in some unit, e.g. cm. jmax=length(tics); for j = 1:jmax # v evaluates to 0 for j=1, L for j=jmax. # It represents the distance from the base of the scale to the jth tic v(j) = L*(pinv(tics(1)) - pinv(tics(j)))/(pinv(tics(1)) - pinv(tics(jmax))); printf(" %f %e\n",tics(j), v(j)); endfor