[R] Three plots with logged X-axis in the same plot

Jim Lemon jim at bitwrit.com.au
Fri May 17 02:57:27 CEST 2013


On 05/16/2013 11:07 PM, Öhagen Patrik wrote:
> Hi Jim,Thank you for your input! I am working with the text and arrow command in each of the graphs. I think it would be far to messy to plot them all in one graph (50+ point estimates and confidence intervals).
>
> par(mfrow=c(1,3)) is a step in the proper direction but I fail to see how I can reduce the amount of unused printing area around the three graphs.
>
>
Hi Patrik,
Perhaps you could simply change the aspect ratio of the plot. Try this:

med_names<-c("Alcohol Amnestic Disorder",
"Alcoholic Cirrhosis",
"Korsakoff Syndrome",
"Alcoholic Seizure",
"Alcoholic Polyneuropathy",
"Adrenoleukodystrophy",
"Alexander Disease",
"Alexia",
"Allergic Angiitis",
"Allergy, Food",
"Alphanodavirus",
"alpha-Thalassemia",
"Alphavirus Infection",
"Alstrom Syndrome",
"Altitude Sickness",
"Alzheimer Dementia",
"Bladder Stones",
"Blastomycosis",
"Nasal Bleeding",
"Blepharospasm",
"River Blindness",
"Blisters",
"Sinoatrial block",
"Bundle Branch blocks",
"Blood Borne Pathogens",
"Blood Coagulation Disorder",
"Blood Group Incompatibility",
"Surgical Blood Loss",
"Blood Poisoning",
"Hypertentsion",
"Bluecomb Virus",
"Blue-Eared Pig Disease",
"Blunt Injury",
"Chalones",
"Charcot Marie Tooth Disease",
"Chest Pain",
"Chiari's Syndrome",
"Chigoe Flea",
"Childbirth, Home",
"Chlamydia Infection",
"Choanal Atresia",
"Cholecystolithiasis",
"Cholera Morbus",
"Chondromalacia Patellae",
"Choreic Movement",
"Chorioretinitis",
"Christmas Disease",
"Chromosomal Inversion",
"Chromosome Disorder",
"Chronic Fatigue Disorder",
"Chronic Wasting Disease",
"Churg-Strauss Syndrome")
hr_min<-sample(45:80,52,TRUE)
hr_max<-hr_min+sample(10:40,52,TRUE)
x11(height=10)
plot(50,xlim=range(c(hr_min,hr_max)),ylim=c(0,53),type="n")
arrows(x0=hr_min,y0=0.5:51.5,x1=hr_max,code=3,length=0.03,angle=90)
text((hr_min+hr_max)/2,1:52,med_names,cex=0.6)

Jim



More information about the R-help mailing list