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

How to implement the facet grid feature using the ggfortify library on a time series data?

I am using RStudio and I have a time series data (ts object) called data1. Here is how data1 looks: Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec 2014 135 172 179 189 212 47 301 183 247 292 280 325 2015 471 243 386 235 388 257 344 526 363…
user3115933
  • 4,303
  • 15
  • 54
  • 94
0
votes
0 answers

Nested x axis labels wrong way around ggoplot2 R

I have this plot, but i want to change around the order of the X axis labels. It should start with the site number (eg. X27a, X28a, W15c, W17c) Then the group (eg. A, B, C, D) and then the last one. So basically i want the very bottom row of labels…
0
votes
1 answer

Different colors for different facet subgroups in R

I have the following R code to generate a twins heights plot faceted by cohort and zygosity: heights_plot = twinData %>% ggplot(mapping = aes(ht1, ht2)) + geom_point() + facet_grid(cohort ~ zygosity) + ggtitle("Cohort and Zygosity Facet Plot by…
Jin Yu Li
  • 103
  • 3
  • 12
0
votes
1 answer

How to connect observations containing NAs using ggplot for facetting?

Just aiming to use connect observations containing NAs using ggplot and the facet option df <- data.frame( time = 1:5, y1 = c(4, 2, 3, 1, NA), y2 = c(4, 5, NA, 6, 10), y3 = c(8, 7, NA, 4, 5) ) library(ggplot2) ggplot(df,…
dambach
  • 79
  • 7
0
votes
1 answer

overlay geom_point with position=dodge and facet grid in ggplot2

Considering the following data, I am able to generate a plot which describes how the risk of a react over a time interval changes. risk_1 <-…
user08041991
  • 617
  • 8
  • 20
0
votes
1 answer

How to manually choose the colors of a box plot with significance in ggplot2?

I have a data frame like this: values TF group_num group 1 0.22722942 FALSE 5 5 2 -0.36530296 TRUE 3 3 3 0.38795866 FALSE 4 4 4 0.48439459 FALSE 4 4 5 0.93879881 FALSE 4 …
user3576287
  • 932
  • 3
  • 16
  • 30
0
votes
1 answer

plotting multiple charts using facet grid

I'm working on a time series of different stocks, and I am getting some issues in plotting them efficiently. So my dataset looks like this: A B C D 1/2/2012 0.007 0.012 0.015 0.009 1/3/2012 0.009 0.012 …
samael
  • 29
  • 1
  • 6
0
votes
1 answer

ggplot facet_grid data.table order bug

When I try to use ggplot together with data.table I discovered an odd behaviour which seems to be a bug. Depending on the order of the rows I set in my data.table (using setkey(data,V1,V2..)), facet_grids differ completely. Here is an example of the…
EddyXorb
  • 68
  • 7
0
votes
1 answer

ggplot2 facet_wrap doesn't find a variable but shape does

I'm running in a bit of a problem plotting some data with ggplot2: I want to use a facet_wrap over a variable AdultInputProp, but R doesn't find the variable and instead returns an Error in as.quoted(facets) : object 'AdultInputProp' not found. Now…
Arthur Spoon
  • 442
  • 5
  • 18
0
votes
1 answer

Automatically order x axis on ggplot2 histogram in a nicely way

I have a dataset like this (but with hundreds of samples): data <- structure(list(sample = c("C001", "C001", "C001", "C001", "C001", "C001", "C001", "C001", "C001", "C001", "C001", "C001", "C001", …
abichat
  • 2,317
  • 2
  • 21
  • 39
0
votes
2 answers

How to show higher values in ggplot2 within facet_grid

I have just found the function facet_grid in ggplot2, it's awesome. The question is: I have a list with 6 countries (column HC) and destination of flights all around the world. My data look like this: HC Reason Destination freq …
Tito Sanz
  • 1,280
  • 1
  • 16
  • 33
0
votes
1 answer

Placing labels outside of the strips in facet_grid

I wonder that how can we place labels left or right side of the facet_grid strips. As a reproducible example I would like to start with this example library(ggplot2) ggplot(mtcars, aes("", hp)) + geom_boxplot(width=0.7,…
Alexander
  • 4,527
  • 5
  • 51
  • 98
0
votes
0 answers

facet_grid() ignores argument labeller in ggplot R

I am trying to assign names to the Class by which facet_grid() splits the plot using the "labeller =" argument but it is ignored when I am using it in a particular dataset. The syntax works though with the following reproducible example using…
rf7
  • 1,993
  • 4
  • 21
  • 35
0
votes
1 answer

Rotate a faceted, grouped bar plot

**UPDATED BELOW I have created a plot, I literally need it horizontal, but the coord_flip() leaves the facets on the bottom instead of having nested groups on the left. The data: srvc_data <- structure(list(dept = structure(c(3L, 3L, 3L, 3L, 3L, 3L,…
Alex
  • 971
  • 4
  • 15
  • 28
0
votes
1 answer

How do I implement the FacetGrid function in my Python codes?

I am new to Python and below is an extract of some Python codes in my Jupyter Notebook: import pandas as pd import matplotlib.pyplot as plt import numpy as np import seaborn as sns sns.set(style="darkgrid") FacetGrid.set(yticks=np.arange(0, 500,…
user3115933
  • 4,303
  • 15
  • 54
  • 94