Multiple Choices: Based Plot: Scatter Plot
Here are 10 multiple-choice exercises on creating scatter plots in R without using the ggplot2
package, focusing on base R plotting functions.
- Which function in base R is commonly used to create a scatter plot? ::: {.cell}
- How do you add a title to a scatter plot in base R? ::: {.cell}
:::
- To change the x-axis label in a scatter plot, which argument would you use? ::: {.cell}
:::
- How can you change the color of the points in a scatter plot? ::: {.cell}
:::
- Which argument changes the symbol (shape) of the points in a scatter plot? ::: {.cell}
:::
- Which code below will create a scatter plot with red points and a title “My Scatter Plot”? ::: {.cell}
:::
- If you want to add a grid to your scatter plot, which function would you use after
plot()
? ::: {.cell}
:::
- To add a regression line to a scatter plot, which function would you use? ::: {.cell}
:::
- Which argument changes the size of the points in a scatter plot? ::: {.cell}
:::
- How can you add labels for individual points on a scatter plot? ::: {.cell}
:::
- How can you limit the x-axis range to show only values between 0 and 100 in a scatter plot? ::: {.cell}
:::
- What function would you use to save a scatter plot as a PNG file? ::: {.cell}
:::
- How would you set the background color of the plotting area to light gray? ::: {.cell}
:::
- If you want to overlay a density plot on top of a scatter plot, which function should you use after creating the scatter plot? ::: {.cell}
:::
- How do you change the aspect ratio of a scatter plot in base R to ensure that one unit on the x-axis is the same length as one unit on the y-axis? ::: {.cell}
:::
- Which function allows you to add points to an existing plot without creating a new plot? ::: {.cell}
:::
- To add a legend to a scatter plot with different colors for two groups of points, which function should you use? ::: {.cell}
:::
- Which argument in the
plot()
function allows you to specify the type of plot (e.g., lines, points, both)? ::: {.cell}
:::
- What command can be used to add a smooth curve to a scatter plot by fitting a loess (local regression) line? ::: {.cell}
:::
- If you want to create a scatter plot in which the point size represents a third variable (e.g.,
z
), which argument would you use? ::: {.cell}
:::
- How can you rotate the y-axis label in a scatter plot to make it horizontal? ::: {.cell}
:::
- To remove the axes entirely from a scatter plot, which argument would you use? ::: {.cell}
:::
- When you want to customize tick marks on the x-axis (e.g., add ticks at specific values), which function should you use after
plot()
? ::: {.cell}
:::
- How can you label specific points (e.g., outliers) with their coordinates on a scatter plot? ::: {.cell}
:::
- Which function would you use to add custom axis labels on an existing scatter plot? ::: {.cell}
:::
- How do you adjust the margin space around a plot in base R? ::: {.cell}
:::
- If you want to add a border around the entire plot area, which function should you use? ::: {.cell}
:::
- How can you plot a scatter plot with a logarithmic scale on both axes? ::: {.cell}
:::
- Which argument in the
plot()
function can be used to specify custom limits for both x and y axes simultaneously? ::: {.cell}
:::
- To add multiple scatter plots on the same graphic device (in a grid layout), which function should you use before
plot()
? ::: {.cell}
:::
:::