Questions tagged [facet-grid]

Facet grid is a presentation form which includes panels defined by facetting variables. Facet grid is allowed to show all existed combinations of the concerned variables to reveal relationships between them.

Facet grid is a presentation form which includes panels defined by facetting variables. Facet grid is allowed to show all existed combinations of the concerned variables to reveal relationships between them.

Some graph packages have facet grid plotting tools:

: ggplot2 facet_grid examples

: seaborn FacetGrid examples

642 questions
0
votes
1 answer

Python seaborn facetgrid

I have a count of green/orange/red by salesman for each customer : Something like : sellor customer red green orange 0 73 c1 5 96 15 1 77 c1 88 18 79 2 97 c1 58 59 71 Which I can construct with : df =…
Romain Jouin
  • 4,448
  • 3
  • 49
  • 79
0
votes
0 answers

order geom_point by specific facet

I have a ggplot related question, which should be easy but I could not find the answer yet. I am trying to plot a faceted plot with the code below and this dataset (11 kB). ggplot(plot.dat, aes(x = estimate, y = reorder(countryyear, estimate))) + …
Erdne Htábrob
  • 819
  • 11
  • 29
0
votes
1 answer

faceting based on geom_point when ggplot() empty and multiple shaded geom_rect exist

I am attempting to shade multiple regions of interest on a scatter plot. Based on this answer, I believe I am forced to leave the intial ggplot() call empty, and supplie the geom_rect() calls before the geom_point() call. I have gotten all of this…
ded
  • 420
  • 2
  • 13
0
votes
1 answer

How to pass a list of arguments to facet_grid()

I am trying to pass a list of arguments to facet_grid() to give a function more flexibility but facet_grid() seems to consider everything in the list as faceting variables or something. It's not returning an error but it also is not having the…
John Gagnon
  • 825
  • 1
  • 8
  • 20
0
votes
1 answer

changing the labels in a facet grid in ggplot2

My data frame is as follows > dput(dat2) structure(list(School = structure(c(2L, 2L, 2L, 1L, 1L, 1L, 3L, 3L, 3L), .Label = c("School1", "School2", "School3"), class = "factor"), Year = c(2015L, 2014L, 2013L, 2015L, 2014L, 2013L, 2015L, …
Vikram
  • 51
  • 2
  • 7
0
votes
2 answers

How do I position facet-grid in ggplot2 along the x axis

I am drawing facet_grid using code mg <- ggplot(mtcars, aes(x = mpg, y = wt)) + geom_point() mg + facet_grid(vs + am ~ gear) which gives the following https://i.stack.imgur.com/oakCp.jpg I would like to add some space where I have marked an…
Vik G
  • 539
  • 3
  • 8
  • 22
0
votes
0 answers

writing the x-axis label on all facets without scaling

I want to write the x-axis on all facets but without the scale. The output I tried to use scales='free_x' with scale_x_discrete(drop=FALSE) but it didn't work . plot2 <- ggplot(counter2, aes(x = as.character(week) , y = freq,group=Delivery.time))…
0
votes
0 answers

writing wrong labels on point using fact_wrap() with geom_text()

I want to write the percentage on each point. Data :sample of the data plot code :- plot2 <- ggplot(counter2,aes(x= as.character(week) ,y =freq,group=Delivery.time))+ geom_point(colour = "red")+ geom_line(colour = "red")+ …
0
votes
0 answers

Setting order for facet grids in ggplot2

I'm a beginner user with R and started learning how to use the ggplot2 package around 3 weeks ago. I've tried to produce a plot of some data from a publication so I can better compare it to my own. In this I've used the facet_grid() function, but it…
0
votes
1 answer

How to change legend of facet_grid?

I used R and ggplot to do a small-multiple graph. ggplot(data=datatest,aes(x=Percentage,y=Accuracy,group=interaction(Classifiers, Feature), color=interaction(Classifiers, Feature)))+geom_line()+facet_grid(OS ~ Dataset) The graph I got is: How can…
HAO CHEN
  • 1,209
  • 3
  • 18
  • 32
0
votes
1 answer

arranging columns and sub-columns in ggplot2 using facet_wrap?

I would like to know how can I group plots like the following ggplot (edited in paint): Plot It looks like facet_wrap() and facet_grid() functions cannot be used to arrange the columns and sub-columns. Is there any R package that I can use? Thanks
candle786
  • 41
  • 7
0
votes
1 answer

R label facet grid multiple line evolution

I have a data frame : df2<-data.frame(taux=c(1.30,1.35,1.78,2.17,2.25,0.78,1.35,1.53,1.87,1.78), date=c("Y","M6","M3","M1","D1","Y","M6","M3","M1","D1"), …
Aurélien
  • 103
  • 3
  • 12
0
votes
0 answers

Changing labels in pair-plot?

I'm using pairs() to create a correlations plot and am trying to show labels on the side and bottom instead of the diagonal panel but can't seem to find a way to do it library(colorspace) x <- matrix(rnorm(120 * 5), ncol = 5) col <-…
B.Shermeister
  • 507
  • 2
  • 6
  • 17
0
votes
1 answer

mathematical expressions in ggplot facet titles

I have the following task: I want to create a facet graph in which the facet titles have mathematical expressions. This is some…
Nicolas Molano
  • 693
  • 4
  • 15
0
votes
1 answer

facet_grid() and color condition

I have some questions about visualization. I have dataframe: df <- data.frame( Campaign = c('month 10', 'month 11','month 10', 'month 11','month 10', 'month 11'), name = c('TI', 'TI', 'SI', 'SI', 'NPS', 'NPS'), values = c(93,96,83,84, 43,36))…
bla bloa
  • 17
  • 5