Graphics Flashcards
1
Q
plot()
A
- Function in base R t hat is the most important high level function.
- First argument is data, usually a vector, but could be a data frame.
- Second argument can also be data, but could also be almost anything.
2
Q
plot() a data frame
A
- plot(data) gives a scatterplot matrix.
3
Q
plot() two vectors
A
- plot(x_variable or x_dataframe_column, y_variable or y_dataframe_column).
- Implies “y as a function of x”.
4
Q
par(mfrow=c())
A
- Function nested that will essentially create spaces in an imaginary matrix in which to fill in with plots and graphs.
- Determines how many graphics will appear in a single plot window.
5
Q
par()
A
- Function to examine the default graphical settings.
6
Q
Colors
A
- 657 base colors in R.
1) col=
2) fg =
3) bg =
4) col.main =
5) col.axis = - When putting colors in the arugments using the c() function, must have parantheses, be all lower case, and be surrounded by quotations.
7
Q
col =
A
- Option used for the colors of lines, symbols and text.
8
Q
fg =
A
- Option used for colors of axes and borders.
9
Q
bg =
A
- Option used for the color of the background or fill.
10
Q
col.main =
A
- Option used for the color for the plot title.
11
Q
col.axis =
A
- Option used for the color for the axis labels.
12
Q
lty =
A
- Option that controls the appearance of lines on a plot.
- Values 1 - 6 are used to create different line styles.
13
Q
lwd =
A
- Option that controls the line thickness.
- Defaults to 1 + lwd = 2 is twice as thick as default, lwd = 3 is three times as thick, etc.
14
Q
ps =
A
- Option that controls the absolute font size setting.
- Default is 16.
15
Q
cex =
A
- Option that controls character expansion = size of the text.
- Multiplier and default is 1.
- Final font specification is ps * cex.
- Can also affect plot symbols.
16
Q
cex.axis =
A
- Option that controls the text draw as tick labels.