- Trending Categories
- Data Structure
- Operating System
- MS Excel
- C Programming
- 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 base R plot axes titles in italics?
To display base R plot axes titles in italics, we can follow the below steps −
First of all, create two vectors and plot them using plot function.
Then, use expression function for ylab and xlab to change the axes titles into italics font.
Create the vectors and plot them
Let’s create two vectors Rate and Demand and plot them using plot function −
Rate<-sample(1:10,25,replace=TRUE) Demand<-sample(1:10,25,replace=TRUE) plot(Rate,Demand)
On executing, the above script generates the below output(this output will vary on your system due to randomization) −
Convert axes titles to italics
Using expression function with italic function to convert the axes titles into italic font −
Rate<-sample(1:10,25,replace=TRUE) Demand<-sample(1:10,25,replace=TRUE) plot(Rate,Demand,ylab=expression(italic("Demand")),xlab=expression(italic("Rate")))
- Related Articles
- R Programming how to display both axes’ labels of a ggplot2 graph in italics?
- How to display fraction in base R plot?
- How to display infinity symbol in base R plot?
- How to display x-bar in base R plot?
- How to create a plot in base R with mixed font of plot title such as default and italics?
- How to display square root sign in base R plot?
- How to display text in base R plot with outline?
- How to display mean with underline in base R plot?
- How to create a base R plot without axes but keeping the frame of the plot?
- How to display axes ticks and labels inside the plot using ggplot2 in R?
- How to make the axes widths in a plot wider than default in base R?
- How to remove the plot margin in base R between the axes and the points inside the plot?
- How to create a plot in base R with tick marks but excluding axes lines?
- How to display text in base R plot with 180 degrees rotation?
- How to display X-axis labels inside the plot in base R?