• Register
0 votes

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 :


Also I want to make the scatterplot as follows:

ggplot(data = df,aes(x = date,y = val)) + 
 geom_point(aes(group = trt))
6 5 3
7,540 points

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:


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.

9 7 4
38,600 points

Related questions

0 votes
1 answer 4 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 24.4k points
0 votes
1 answer 2 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.4K 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 1.8K 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
1 vote
1 answer 81 views
Problem: I am a naive to R. I am trying to create the bar graph using the ggplot2 to compare a type of 2016 primary election and the Bernie Sanders's respective percentage of the votes in that election. I have below code: y = $ Type : Factor w/ 2 levels ... data of class uneval. I have already tried to search the solution on above error around but because of some unknown reasons to me I am stuck.
asked May 27, 2020 Martin K 6.6k points
1 vote
1 answer 61 views
Problem : I am trying to understand R and I am very new to Programming as wel. If I try to create the box chart with the use of standard error bars I often face below error message: “Error: ggplot2 doesn't know how to deal with data of class numeric”. Looking for help in quick fixing the above error.
asked May 5, 2020 stewart 4k points
1 vote
2 answers 103 views
Problem : I have recently started using R I am very new to R while working on R I am facing the below error whenever I try to create the graph on the ggplot: &ldquo;Error: ggplot2 doesn't know how to deal with data of class gg/ggplot&rdquo; I often face the error message if ... = Cost)) MyCars %>% ggplot() %>% geom_point(mapping = aes(x = Destination, y = Cost)) I need help in fixing above error.
asked Mar 30, 2020 morrisBson 3.2k points
0 votes
1 answer 196 views
0 votes
1 answer 302 views
0 votes
1 answer 453 views
Problem: I have very good knowledge of r, ggplot and unix. I am now a days trying to analyze the dataset of the GSR values. I had first transformed my all the required unix values into the readable data and after that I created the plot of my GSR values in the ... . But I had already supplied the origin when I tried to transform my unix into the readable data and also again in the ggplot code.
asked Jul 27, 2020 Raphael Pacheco 4.9k points