I am not able to restrict axes to a given extension if I want to add text to a plot outside the area of the xlim(or ylim) area.
I tried to use par(usr) or par(xaxp) both seem not to work. (I am fairly new to R and did not use a non-Mac version before - possibly I misunderstand those par or some other function/approach makes this easy).
Does anybody have an idea how to get rid of surplus axes.
I hope this example is easily reproducable (Wanted: to get rid of negative axis in this case):
ws<- c(0,0,5,7,18,31)
labF2<- c("Industrie","Finanzdienst","Transport,Telekom","Tourismus","Gewerbe,andere Dienstleistung" "Handel" )
barplot(ws, main="Wirtschaftssektor, Fachgruppe",horiz=T,names.arg=NULL,xlim=c(-68,40),xaxp=c(0,40,4) )
text(-63,seq(0.6,length=6,by=1.2),labF2,adj=0)
wsc<- as.character(ws)
barplot(ws, main="Wirtschaftssektor, Fachgruppe",horiz=T,names.arg=NULL,xlim=c(-68,40),xaxp=c(0,40,4) )
text(-63,seq(0.6,length=6,by=1.2),labF2,adj=0)
text(ws-nchar(wsc)-3,seq(0.6,length=6,by=1.2),wsc,adj=0)
(right hand justification needs Hershey fonts which print not so clean numbers inside the bars)
Peter Paul Sint (sint@oeaw.ac.at, http://www.iwe.oeaw.ac.at/sint )
Institutional Change and European Integration, Austrian Academy of Sciences
ICE,Baeckerstr.13 ,A-1010 Wien/Vienna, Austria, EU +431-51581-445(fax-566)
Answer to my previous question on negative axis deletion
Plot barplot without axes.
Add restricted axis afterwards.
ws<- c(0,0,5,7,18,31)
labF2<- c("Industrie","Finanzdienst","Transport,Telekom","Tourismus","Gewerbe,andere Dienstleistung","Handel" )
barplot(ws, main="Wirtschaftssektor, Fachgruppe",horiz=T,names.arg=NULL,xlim=c(-68,40),xaxp=c(0,40,4) ,axes=F )
text(-63,seq(0.6,length=6,by=1.2),labF2,adj=0)
axis(1,c(0,20,40,60))
I am still interested in a way to do it whith the plot/barplot command.
Does anybody have an idea how to plot AND save a series of graphs (not the commands to plot them) unattended (for a slightly changed data set/data frame)?
At 5:59 Uhr +0200 06.06.2001, Peter Paul Sint wrote:
I am not able to restrict axes to a given extension if I want to add text to a plot outside the area of the xlim(or ylim) area.
I tried to use par(usr) or par(xaxp) both seem not to work. (I am fairly new to R and did not use a non-Mac version before - possibly I misunderstand those par or some other function/approach makes this easy).
Does anybody have an idea how to get rid of surplus axes.
I hope this example is easily reproducable (Wanted: to get rid of negative axis in this case):
ws<- c(0,0,5,7,18,31)
labF2<- c("Industrie","Finanzdienst","Transport,Telekom","Tourismus","Gewerbe,andere Dienstleistung" "Handel" )
ws
F2.3 F2.5 F2.6 F2.2 F2.1 F2.4
0 0 5 7 18 31
labF2
[1] "Industrie" "Finanzdienst"Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â
[3] "Transport,Telekom" "Tourismus"Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â
[5] "Gewerbe,andere Dienstleistung" "Handel"Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â
barplot(ws, main="Wirtschaftssektor, Fachgruppe",horiz=T,names.arg=NULL,xlim=c(-68,40),xaxp=c(0,40,4) )
text(-63,seq(0.6,length=6,by=1.2),labF2,adj=0)
wsc<- as.character(ws)
barplot(ws, main="Wirtschaftssektor, Fachgruppe",horiz=T,names.arg=NULL,xlim=c(-68,40),xaxp=c(0,40,4) )
text(-63,seq(0.6,length=6,by=1.2),labF2,adj=0)
text(ws-nchar(wsc)-3,seq(0.6,length=6,by=1.2),wsc,adj=0)
(right hand justification needs Hershey fonts which print not so clean numbers inside the bars)
Peter Paul Sint (sint@oeaw.ac.at, http://www.iwe.oeaw.ac.at/sint )
Institutional Change and European Integration, Austrian Academy of Sciences
ICE,Baeckerstr.13 ,A-1010 Wien/Vienna, Austria, EU +431-51581-445(fax-566)