Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask question.(5)

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

ITtutoria

ITtutoria Logo ITtutoria Logo

ITtutoria Navigation

  • Python
  • Java
  • Reactjs
  • JavaScript
  • R
  • PySpark
  • MYSQL
  • Pandas
  • QA
  • C++
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Python
  • Science
  • Java
  • JavaScript
  • Reactjs
  • Nodejs
  • Tools
  • QA
Home/ Questions/Error in .call.graphics(c_palette2, .call(c_palette2, null)): invalid graphics state - simple way to solve it
Next
Answered
Aaron Paul
  • 5
Aaron Paul
Asked: May 17, 20222022-05-17T12:48:35+00:00 2022-05-17T12:48:35+00:00In: r

Error in .call.graphics(c_palette2, .call(c_palette2, null)): invalid graphics state – simple way to solve it

  • 5

. Advertisement .

..3..

. Advertisement .

..4..

I’m trying to run a new project. I do a couple of things like this:

date trt var val
 1/8/2008 cc sw5 0.2684138
 1/8/2008 cc sw15 0.2897586
 1/8/2008 cc sw5 0.2822414
 2/8/2008 cc sw5 0.2494583
 2/8/2008 cc sw5 0.2692917
 2/8/2008 cc sw15 0.2619167
 2/8/2008 cc sw5 0.204375
 3/8/2008 cc sw5 0.2430625
 3/8/2008 cc sw5 0.2654375
 3/8/2008 cc sw5 0.2509583
 3/8/2008 cc sw5 0.2055625
 1/8/2008 ccw sw15 0.2212414
 1/8/2008 ccw sw5 0.3613448
 1/8/2008 ccw sw5 0.2607586
 2/8/2008 ccw sw5 0.2087917
 2/8/2008 ccw sw15 0.3390417
 2/8/2008 ccw sw5 0.2436458
 2/8/2008 ccw sw5 0.290875
 3/8/2008 ccw sw5 0.20175
 3/8/2008 ccw sw15 0.328875
 3/8/2008 ccw sw5 0.2328958
 3/8/2008 ccw sw5 0.2868958
df<-df[order(as.Date(df$date,format="%d/%m/%Y")),,drop=FALSE]
ggplot(data = df,aes(x = date,y = val)) + 
  geom_point(aes(group = trt))

But in my program, I am getting the warning:

Error in .Call.graphics(C_palette2, .Call(C_palette2, NULL)) : 
  invalid graphics state

Can someone explain why the “error in .call.graphics(c_palette2, .call(c_palette2, null)): invalid graphics state” issue happened? Where have I gone wrong? Thank you!

ggplot2
  • 2 2 Answers
  • 42 Views
  • 0 Followers
  • 0
Answer
Share
  • Facebook
  • Report

2 Answers

  • Voted
  • Oldest
  • Recent
  • Random
  1. Best Answer
    dttutoria Expert
    2022-06-03T16:58:02+00:00Added an answer on June 3, 2022 at 4:58 pm

    The cause: The error invalid graphics state occurs as the present plot window is too small to satisfy the requirements of the displayed plot.

    Solution: You should expand the plot window by deleting all the plots in the console to create a large plot area. Then, the graphics state will not be reported error anymore.

    • 24
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report
  2. Maël Masson
    2022-05-25T19:56:54+00:00Added an answer on May 25, 2022 at 7:56 pm

    This happens when you combine ggplot and plot charts within the same session. Paul suggested a solution: “dev.off”.

    • 23
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

Sidebar

Ask A Question
  • How to Split String by space in C++
  • How To Convert A Pandas DataFrame Column To A List
  • How to Replace Multiple Characters in A String in Python?
  • How To Remove Special Characters From String Python

Explore

  • Home
  • Tutorial

Footer

ITtutoria

ITtutoria

This website is user friendly and will facilitate transferring knowledge. It would be useful for a self-initiated learning process.

@ ITTutoria Co Ltd.

Tutorial

  • Home
  • Python
  • Science
  • Java
  • JavaScript
  • Reactjs
  • Nodejs
  • Tools
  • QA

Legal Stuff

  • About Us
  • Terms of Use
  • Privacy Policy
  • Contact Us

DMCA.com Protection Status

Help

  • Knowledge Base
  • Support

Follow

© 2022 Ittutoria. All Rights Reserved.

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.