• Register
0 votes
2.7k views

Problem :

I think my dataframe is correct and my code is also okay. But I am facing following error:

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

What is wrong with my below data?

 date   trt var val
1/12/2019    cc  sw5 0.2684138
1/12/2019    cc  sw15    0.2897586
1/12/2019    cc  sw5 0.2822414
2/12/2019    cc  sw5 0.2494583
2/12/2019    cc  sw5 0.2692917
2/12/2019    cc  sw15    0.2619167
2/12/2019    cc  sw5 0.204375
3/12/2019    cc  sw5 0.2430625
3/12/2019    cc  sw5 0.2654375
3/12/2019    cc  sw5 0.2509583
3/12/2019    cc  sw5 0.2055625
1/12/2019    ccw sw15    0.2212414
1/12/2019    ccw sw5 0.3613448
1/12/2019    ccw sw5 0.2607586
2/12/2019    ccw sw5 0.2087917
2/12/2019    ccw sw15    0.3390417
2/12/2019    ccw sw5 0.2436458
2/12/2019    ccw sw5 0.290875
3/12/2019    ccw sw5 0.20175
3/12/2019    ccw sw15    0.328875
3/12/2019    ccw sw5 0.2328958
3/12/2019    ccw sw5 0.2868958

Whenever I want to work with above data, I specify dates like below :

df<-df[order(as.Date(df$date,format="%d/%m/%Y")),,drop=FALSE]

Also I want to make the scatterplot as follows:

ggplot(data = df,aes(x = date,y = val)) + 
 geom_point(aes(group = trt))
7.5k points
edited by

Please log in or register to answer this question.

1 Answer

0 votes

Solution :

I also faced the same error in the past and I managed to fix it by running following code:

dev.off()

and after that running my plot again. I guess my graphics device was messed up earlier also by exporting some graphics I tried but it didn't get reset. But This worked for me.

38.6k points
<a href=http://vsviagrav.com/>viagra out of system

Related questions

0 votes
1 answer 68 views
68 views
Problem: Please help me &hellip; how can I solve it? error in .call.graphics(c_palette, value) : invalid graphics state
asked Mar 31 Ifra 43.4k points
0 votes
1 answer 46 views
46 views
Problem: Where should I seek assistance with this problem : Error in usemethod("depth") : no applicable method for 'depth' applied to an object of class "null"?
asked Jun 10 Mezbah 130k points
0 votes
1 answer 2.3k views
2.3k views
Problem : I am getting bellow error message error in grid.call.graphics(c_setviewport, vp, true) : non-finite location and/or size for viewport
asked Nov 7, 2019 peterlaw 6.9k points
0 votes
1 answer 56 views
56 views
Problem: After installing Rstudio when I put the command I get . Error in grid.call(l_textbounds, as.graphicsannot(x$label), x$x, x$y, : polygon edge not found.
asked Apr 24 PkGuy 25.9k points
0 votes
1 answer 25 views
25 views
Problem : facing following issue: error in grid.call(c_textbounds, as.graphicsannot(x$label), x$x, x$y, : polygon edge not found. Any help!!
asked Mar 15 Wafa Abu Yousef 6.1k points
0 votes
1 answer 1.8k views
1.8k views
Problem : I installed RStudio on Mac OS X, version 10.7.3 but facing following issue. error in grid.call(c_textbounds, as.graphicsannot(x$label), x$x, x$y, : polygon edge not found
asked Nov 13, 2019 peterlaw 6.9k points
0 votes
1 answer 18 views
18 views
Problem: What is wrong here : Error in grdevices::col2rgb(colour, true) : invalid color name?
asked Jun 22 Chi Omega 168k points
0 votes
1 answer 7 views
7 views
Problem: Input string 1 is invalid in this locale
asked Jul 19 nila 121k points
0 votes
1 answer 11 views
11 views
Problem: Where will I able to find an answer for this : Error: geomrasterann was built with an incompatible version of ggproto.?
asked Jun 17 nila 121k points
0 votes
1 answer 23 views
23 views
Problem: Need a solution for this > Error:ggplot2 doesn't know how to deal with data of class gg/ggplot
asked May 9 Aurelia Maja 78.4k points