- Trending Categories
- Data Structure
- Operating System
- C Programming
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to put labels on a scatterplot that is created plot function in R?
Labelling of points on a scatterplot helps us to identify the pair of observations. For example, if we are plotting weight and height of people then we can label it with person’s name, therefore, we will be able to understand which pair of points belong to which person. This can be done by using text function after creating the scatterplot with plot function.
x <-c(2,4,5,8,10) y <-c(15,25,27,29,30) plot(x,y)
Now suppose we have labels and want to add them on the above plot then it can be done as follows −
Labels <-c("One","Two","Three","Four","Five") text(x,y,labels=Labels,cex=0.4,pos=3)
- How to join points on a scatterplot with smooth lines in R using plot function?
- How to reverse the X-axis labels of scatterplot created by using ggplot2 in R?
- How to change the color and size of the axes labels of a plot created by using plot function in R?
- How to apply manually created x-axis labels in a histogram created by hist function in R?
- How to change the axes labels using plot function in R?
- How to add a vertical line with some value on a scatterplot created by ggplot2 in R?
- How to change the background color of a plot created by using plot function in R?
- How to change the position of the title of a plot which is created using plot function in R?
- How to create gridlines that matches with Y-axis values in the plot created by using plot function in R?
- How to add a mathematical expression in axis label in a plot created by using plot function in R?
- How to label points in scatterplot created by using xyplot in R?
- How to plot the X-axis labels on the upper-side of the plot in R?
- How to create the stacked bar plot using ggplot2 in R with labels on the plot?
- How to display ID column values in a scatterplot created with ggplot2 in R?
- How to put xtick labels in a box matplotlib?