I have a table of sensitivity indices for some parameters and I would like to draw a graph that looks like the attached graph.
Here are my sensitivity indices.
k = 1
p = 0.01018
alpha = 0.01381
beta1 = 0.65307
beta2 = 0.28410
zeta = -0.793134
gamma1 = -0.66854
gamma2 = -0.23908
eta = 0.01653
I would highly appreciate if someone could please help me on this. Thanks a ton!
Using barplot
. Put values in a named vector, and use expression
s for the greek letters.
v <- c(alpha=alpha, beta1=beta1, beta2=beta2, eta=eta, gamma1=gamma1,
gamma2=gamma2, k=k, p=p, zeta=zeta)
labs <- c(expression(alpha), expression(beta[1]), expression(beta[2]),
expression(eta), expression(gamma[1]), expression(gamma[2]),
expression(italic(k)), expression(italic(p)), expression(zeta))
b <- barplot(rev(v), horiz=T, col='#342a85', xlim=c(-1, 1)*1.03, axes=F, yaxt='n')
sapply(c(1, 3), \(i) axis(i, seq.int(-1, 1, .2), labels=FALSE, tck=.02))
sapply(c(2, 4), \(i) axis(i, b, labels=FALSE, tck=.02))
mtext(rev(labs), 2, .5, at=b, las=2, family='serif', cex=1.2)
mtext(seq.int(-1, 1, .2), 1, .5, at=seq.int(-1, 1, .2), family='serif', cex=1.2)
mtext('PRCC Values', 1, 2.5, cex=1.2)
abline(v=0)
box()