- Trending Categories
- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- 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

To create a plot with reversed Y-axis we need to use the rev function for the Y-axis labels with ylim but we would also need to define the range for the y-axis values, otherwise, R will throw an error. For example, if we have two vectors named as x and y then the plot with reversed Y-axis labels can be created by using plot(x,ylim=rev(range(y))).

x<-1:10 y<-1:10 plot(x,y)

Creating the plot with reversed Y-axis labels −

plot(x,ylim=rev(range(y)))

- Related Questions & Answers
- How to create a plot with tick marks between X-axis labels in base R?
- How to create bar plot in base R with different limits for Y-axis?
- How to remove Y-axis labels in R?
- How to display X-axis labels inside the plot in base R?
- How to create a plot in base R with dates sequence on X-axis?
- How to create a bar plot using ggplot2 with percentage on Y-axis in R?
- How to use mtext function to create the X-axis labels in base R?
- How to create horizontal line for Y variable at median in base R plot?
- How to create a dendrogram without X-axis labels in R?
- How to create a barplot with gaps on Y-axis scale in R?
- How to create boxplot in base R without axes labels?
- How to create a plot with dashed regression line in base R?
- How to create gridlines that matches with Y-axis values in the plot created by using plot function in R?
- How to create a plot in base R without margins?
- How to create a perpendicular arrow in base R plot?

Advertisements