- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
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 fraction in base R plot?
To display fraction in base R plot, we can use frac function in text function.
For example, if we create a plot of vectors called X and Y with display of over form fraction as X over Y at X=2 and Y= 2 then we can use the following code −
text(2,2,expression(Output==frac(X,Y)))
Check out the below examples to understand how it works.
Example 1
To display fraction in base R plot, use the code given below −
plot(1:5,type="n") text(2,4,expression(Output==frac(x,y)))
Output
If you execute the above given code, it generates the following output −
Example 2
To display fraction in base R plot, use the code given below −
plot(rpois(5,2)) text(4,0.5,expression(Rate==frac(1,lambda)))
Output
If you execute the above given code, it generates the following output −
- Related Articles
- How to display x-bar in base R plot?
- How to display infinity symbol in base R plot?
- How to display base R plot axes titles in italics?
- How to display text in base R plot with outline?
- How to display mean with underline in base R plot?
- How to display square root sign in base R plot?
- How to display fraction in a plot title using ggplot2 in R?
- How to display text in base R plot with 180 degrees rotation?
- 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 X-axis labels with dash 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 the superscript for a single variable in a base R plot?
- How to rotate text in base R plot?

Advertisements