जब मैं निम्नलिखित साजिश बनाने मैं अंकन क्षेत्र और (अक्ष नीले बॉक्स और एक्स अक्ष के बीच यानी सफेद स्थान के बीच अवांछित स्थान मिलता है। मैं इस स्थान निकाल कर बना सकते हैं साजिश के साथ साजिश रचने क्षेत्र फ्लश अक्ष? धन्यवाद।निकालें आसपास रिक्ति r में क्षेत्र की साजिश रचने
xleft<-c(1,2,2.5)
xright<-c(2,2.5,2.75)
ybottom<-c(1,2,2.5)
ytop<-c(2,2.5,2.75)
par(mar = c(15,15,2.75,2.75) + 0.1)
plot(c(1,2.75),c(1,2.75),type="n",main="title",xlab="site.x",ylab="ylab")
rect(xleft,ybottom,xright,ytop,col=c("blue","red","green"))
#Label position along axes
x.label.position<-(xleft+xright)/2
y.label.position<-(ybottom+ytop)/2
#Labels
x.label<-c("Long species Name1","Long species Name2","Long species Name3")
y.label<-c("Long species Name4","Long species Name5","Long species Name5")
text(par()$usr[1]-0.5,y.label.position,y.label,xpd=TRUE,adj=1)
text(y=par()$usr[3]-0.5,x=x.label.position,x.label,xpd=TRUE,adj=1,srt=90)
par(xpd=TRUE)
legend(-0.1,0,legend=c("Species A","Species B","Species C"),fill=c("blue", "red", "green"))
अद्यतन मैं अपने वास्तविक डेटा के साथ plannapus से सुझाव की कोशिश की लेकिन केवल व्यवहार करने के लिए y- अक्ष प्राप्त कर सकते हैं इस में कुछ और है कोड है कि साजिश रचने क्षेत्र के पक्षों के लिए अंतरिक्ष जोड़ने का हिस्सा?
quartz("colour.plot")
par(mar=c(15,15,4,2)+0.1)#sets margins of plotting area
#create the data plot
plot(c(0,100), c(0,100), type = "n", main = paste(x,"vs",y," -",depth),xlab=paste("Species composition in remainder ",x),ylab=paste("Species composition in remainder ",y),asp=1,xaxs="i",yaxs="i")
#Add the rectangles
rect(mdf$xleft,mdf$ybottom,mdf$xright,mdf$ytop,col=mdf$colour)
पैदा करता
"कोड के इस टुकड़ा है कि साजिश क्षेत्र के पक्षों के लिए अंतरिक्ष जोड़ने में वहाँ कुछ बाकी है?" हां: 'एएसपी = 1'। इसके साथ आप एक्स और वाई अक्षों को बराबर करने के लिए मजबूर कर रहे हैं, जो शायद आपके साजिश क्षेत्र के आकार के साथ संघर्ष करते हैं। – plannapus
'प्लॉट' को कॉल करने से पहले 'par (pty =" s ") जोड़ने से साजिश क्षेत्र को वर्ग (इसलिए' '' '') होना चाहिए और आपकी छवि के अनुसार आयताकार नहीं होना चाहिए और इसलिए 'asp' के लिए सही होना चाहिए "गड़बड़"। – plannapus
मुझे लगता है कि आप @plannapus जवाब के लिए जाना चाहिए, या simly 'xlim',' ylim' क्षेत्र आप प्लॉट करने के लिए चाहते हैं मैच के लिए निर्धारित किया है। यद्यपि @ एलन का समाधान सही दिखता है, लेकिन यह वैचारिक रूप से सही नहीं है जो आप यहां करना चाहते हैं। यह कहने के लिए केवल "लक्षण ठीक करता है"। – Backlin