 
  Data Structure Data Structure
 Networking Networking
 RDBMS RDBMS
 Operating System Operating System
 Java Java
 MS Excel MS Excel
 iOS iOS
 HTML HTML
 CSS CSS
 Android Android
 Python Python
 C Programming C Programming
 C++ C++
 C# C#
 MongoDB MongoDB
 MySQL MySQL
 Javascript Javascript
 PHP PHP
- 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 the superscript for a single variable in a base R plot?
To display the superscript in a base R plot, we would need to use expression function inside text function. For example, if we want to display X-square inside a blank plot in base R then we can use the below code:
plot(1:10,type="n") text(2,2,expression(X^2))
Example1
> plot(1:10,type="n") > text(2,2,expression(X^2==4))
Output:

Example2
> text(5,5,expression(X^5==Center))
Output:

Example3
> text(9,9,expression(Squared^2))
Output:

Advertisements
 