- 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 set the range for boxplot in base R?
By default, R considers the vector or the data frame column values. But if we want to set the range for boxplot in base R, we can use ylim argument within the boxplot function. For example, if we have a vector called x that contains values starting from 21 to 50 and we want to have the range in the boxplot starting from 1 to 100 then we can use the command
boxplot(x,ylim=c(1,100))
Example
x<-rnorm(500,10,1) boxplot(x)
Output
Example
boxplot(x,ylim=c(0,15))
Output
Example
boxplot(x,ylim=c(2,20))
Output
- Related Articles
- How to create boxplot for multiple categories in base R?
- How to display star for significance in base R boxplot?
- How to create boxplot for a list object in base R?
- How to hide outliers in base R boxplot?
- How to create a horizontal boxplot in base R?
- How to create boxplot for multiple categories with long names in base R?
- How to set the range of Y-axis for a Seaborn boxplot using Matplotlib?
- How to change the whisker line type in base R boxplot?
- How to change the border line type in base R boxplot?
- How to create side-by-side boxplot in base R?
- How to create boxplot in base R without axes labels?
- How to create a rectangle inside boxplot in base R?
- How to create a boxplot without frame in base R?
- How to change the color of outliers in base R boxplot?\n
- How to change the color of box of boxplot in base R?

Advertisements