- 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 fix the lower value for X-axis in base R
To fix the lower value for X-axis in base R, we can use xlim argument in plot function. Mostly, we set the lower value to zero but it is not necessary it can be something else, either less than zero or greater than zero as well. If only lower value needs to be fixed then upper value will be set by using the max function as shown in the below example.
Example
x<-rnorm(20) y<-rnorm(20,1,0.04) plot(x,y)
Output
Example
plot(x,y,xlim=c(0,max(x)))
Output
Advertisements