- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
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 deal with error invalid xlim value in base R plot?
The error invalid xlim value occurs when we incorrectly provide the xlim values, these values are not used in sequence, we just need to provide first and the last value. For Example, if we want to create a point chart of 1 to 5 with xlim having values between -5 to 15 then we can use the command as follows −
plot(1:5,xlim=c(-5:15))
Example
Add the following code to the above command −
plot(1:10)
Output
If you execute the above given command, it generates the following Output −
Add the following code to the above snippet −
plot(1:10) plot(1:10,xlim=c(-15:15)) Error in plot.window(...) : invalid 'xlim' value Correct: plot(1:10,xlim=c(-15,15))
Output
If you execute all the above given snippets as a single program, it generates the following Output −
- Related Articles
- How to deal with error “$ operator is invalid for atomic vectors” in R?
- How to highlight a value with underline in base R plot?
- How to deal with “could not find function” error in R?
- How to deal with error “undefined columns selected” while subsetting data in R?
- How to deal with the error “Error in int_abline---plot.new has not been called yet” in R?
- How to assign a value to a base R plot?
- How to deal with error “Error in shapiro.test(…) : sample size must be between 3 and 5000” in R?
- How to deal with error “undefined columns selected when subsetting data frame” in R?
- How to display text in base R plot with outline?
- How to display mean with underline in base R plot?
- How to deal with glm.fit error “NA/NaN/Inf” for logistic regression model in R?
- How to include a zero with tick in base R plot?
- How to deal with Error: stat_count() can only have an x or y aesthetic in R?
- How to rotate text in base R plot?
- How to remove Index in base R plot?

Advertisements