[R] Axis with inverse logarithmic scale

Duncan Murdoch murdoch@dunc@n @end|ng |rom gm@||@com
Mon Jul 27 19:00:57 CEST 2020


On 27/07/2020 11:56 a.m., Dileepkumar R wrote:
> I think the attached sample figure is not visible
> Here is the sample figure:
> https://drive.google.com/file/d/16Uy3JD0wsEucUv_KOhXCxLZ4U-3wiBTs/view?usp=sharing
> 
> sincerely,
> 
> 
> Dileepkumar R
> 
> 
> 
> 
> On Mon, Jul 27, 2020 at 7:13 PM Dileepkumar R <dileepkunjaai using gmail.com>
> wrote:
> 
>> Dear All,
>>
>> I want to plot a simple cumulative probability distribution graph with
>> like the attached screenshot.
>> But I couldn't fix the y-axis scale as in that screenshot.
>>
>> My data details are follows:
>>
>> y_values
>> =c(66.78149,76.10846,81.65518,85.06448,87.61703,89.61314,91.20297,92.36884,
>> 93.64070,94.57693,95.23052,95.75163,96.15792,96.58188,96.97933,97.29730,
>> 97.59760,97.91556,98.14520,98.37485,98.57799,98.74580,98.87829,99.06377,
>> 99.16093,99.25808,99.37290,99.45239,99.54072,99.59371,99.62904,99.66437,
>> 99.69970,99.70853,99.72620,99.73503,99.77036,99.79686,99.80569,99.82335,
>> 99.83219,99.84985,99.86751,99.87635,99.87635,99.90284,99.90284,99.90284,
>> 99.91168,99.92051,99.92051,99.93817,99.93817,99.93817,99.95584,99.95584,
>> 99.97350,99.97350,99.97350,99.97350,99.97350,99.97350,99.97350)
>>
>> x_value=seq(63)
>>
>> Thank you all in advance
>>

You need to figure out what scale was used.  It looks to me like a logit 
scale in y/100.  If that's right, this may show what you want:

scale <- function(y) log(y/100/(1-y/100))
plot(x_value, scale(y_values), axes = FALSE)
axis(1)
ticks <- c(10, 30, 50, 90, 99, 99.9, 99.99, 99.999)
axis(2, at=scale(ticks), labels=ticks)
box()

It doesn't have as large a range as your plot; this will match that:

plot(x_value, scale(y_values), axes = FALSE, ylim = scale(c(10, 99.9995)))

The rest of the code is the same.

Duncan Murdoch



More information about the R-help mailing list