- 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 text in base R plot with outline?
The display of text in base R plot with outline is not possible, for this purpose we would need to use shadowtext function of TeachingDemos package. The shadowtext function will be applied after creating the plot in base R.
We will have to provide the location of the text inside the plot and some other arguments such as text that needs to be displayed, color of outline, and size for better display.
Example 1
Use the following code to display text in base R plot with outline −
plot(1) shadowtext(1.2,1.2,"Point at 1",col="white",cex=2)
Output
If you execute the above given code, it generates the following Output −
Example 2
Use the following code to display text in base R plot with outline −
plot(5) shadowtext(1,6,"Point at 5",col="red",cex=2)
Output
If you execute the above given code, it generates the following
Output
Example 3
Use the following code to display text in base R plot with outline −
plot(1:10) shadowtext(6,2,"Point Chart",col="green",cex=2)
Output
If you execute the above given code, it generates the following Output −
- Related Articles
- How to display text in base R plot with 180 degrees rotation?
- How to display mean with underline in base R plot?
- How to display fraction in base R plot?
- How to rotate text 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 X-axis labels with dash in base R plot?
- 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?
- How to display the superscript for a single variable in a base R plot?
