Timothy Alston
Timothy Alston

Reputation: 1549

Graphics using plot.mc

I need help with some of the graphics on a cumulative distribution plot using plot.mc

An example of what I am doing is as follows:

Require(mc2d)
ndvar(10000)
test<-mcstoc(rbetagen,type="V",shape1=48, shape2=66.42, min=0, max=4000)
hist(test)
test<-mc(test)
plot(test)

This plots the cumulative distribution of "test".

What I want to do, is draw a verticle line up from a specific point on the x-axis (say 1800), which touches the cumulative distribution line, then draws a line across to the Y axis at the point corresponding to 1800 on the x axis.

I have looked up help(plot.mc) and help(plot.stepfun) but neither seem to be able to do this.

Many thanks,

Timothy

Upvotes: 1

Views: 94

Answers (1)

Jilber Urbina
Jilber Urbina

Reputation: 61164

See ?arrows

plot(test)
arrows(x0=0, y0=.745, x1=1800, y1=.745, code=0, lty=2)
arrows(x0=1800, y0=0, x1=1800, y1=.745, code=0, lty=2)

enter image description here

Upvotes: 1

Related Questions