plot yes R Basic drawing tools in , direct plot(x),x For a dataset , You can draw a picture . Details are often the key to success , So let's look at it in detail plot All settable parameters and parameter setting methods of .
The graphic parameters are described below , yes graphic Common parameters in package ,graphic In different graphic methods , These parameters are the same .
1, Symbols and lines
pch Specify the drawing ( stay type=”p”/”o”/”b” Time )
coca cex parameter , Used to control the size of symbols in a graph , Default to cex=1
When PCH by 21-25 Time , Parameter should be specified “col =” and “bg =”.PCH It can also be characters , for example “#”,“%”,“A”,“a”, And the characters will be drawn
lty Specifies the alignment
lwd Change line thickness
2,type Types of graphics
“p” Dot chart
“l” Line diagram
“b” Point line diagram , The line does not pass through the point
“c” Dotted line diagram
“o” Point line diagram , The line goes through the point
“h” histogram
“s” Stairs
“S” Step diagram
“n” No picture
x
png("~/plotSamples.png",width=9,height=9,unit="in",res=108)
# Create in working directory plotSamples.png chart
par(mfcol=c(3,3))
plot(x,
Technology