- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- 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 display mean with underline in base R plot?
To display mean value with underline in base R plot, we can use underline function within text function. The text function will be used to write the word Mean in the plot and underline function will underline the mean.
Check out the below example to understand how it works.
Example
Following snippet creates a sample data frame −
x<-rpois(10,5) x
Output
The following dataframe is created −
[1] 6 3 8 7 11 6 3 5 4 5
To display mean with underline in base R plot, add the following code to the above snippet −
x<-rpois(10,5) plot(x)
Output
If you execute all the above given codes as a single program, it generates the following output −
To display mean with underline in base R plot, add the following code to the above snippet −
text(8,10,bquote("Mean"~underline(.(mean(x)))))
Output
If you execute all the above given codes as a single program, it generates the following output −
- Related Articles
- How to highlight a value with underline in base R plot?
- How to display text in base R plot with outline?
- How to display fraction in base R plot?
- How to display x-bar in base R plot?
- How to display infinity symbol in base R plot?
- How to display text in base R plot with 180 degrees rotation?
- How to display X-axis labels with dash in base R plot?
- How to display mean in a boxplot with cross sign in base R?
- How to display base R plot axes titles in italics?
- How to display square root sign in base R plot?
- How to display X-axis labels inside the plot in base R?
- How to display superscript for X-axis title in base R plot?
- How to display star/asterisk sign (*) inside a base R plot?
- How to display raise to the power on X-axis in base R plot?
- How to display legend in base R with different colors?

Advertisements