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
5
votes
1 answer

ggplot2 problems with using ...prop... and grouping bar graph by another category

StudentData <- data.frame(gender = sample( c("male","female"), 100, replace=TRUE), degree = sample( c("Associates", "Masters", "PhD"), 100, replace=TRUE), category = sample( c("Audit", "Credit"), 100, replace=TRUE)) In…
Syrah.Sharpe
  • 103
  • 1
  • 8
5
votes
1 answer

R: facet_wrap does not render correctly with ggplotly in Shiny app

When I do a facet_grid in ggplotly() for a Shiny App, with a large number of faceting groups, the plot is messed up. However it works correctly outside Shiny. How can I fix this? I suspect it is linked to the Y scale but I couldn't find the…
Jim
  • 65
  • 1
  • 5
5
votes
3 answers

ggplot2: specifying different scales for rows in facet layout for bar plots

My data are visualized in the package ggplot2 via bar plots with several (~10) facets. I want first to split these facets in several rows. I can use function facet_grid() or facet_wrap() for this. In the minimal example data here I build 8 facets in…
astrsk
  • 375
  • 6
  • 20
4
votes
1 answer

How to add an empty facet to a relplot or FacetGrid

I have a relplot with columns split on one variable. I'd like to add one additional column with no subplot or subpanel. To give a clear example, suppose I have the following plot: import matplotlib.pyplot as plt import numpy as np import pandas as…
Rylan Schaeffer
  • 1,945
  • 2
  • 28
  • 50
4
votes
1 answer

How to customize the text ticklabels for each subplot of a seaborn catplot

Let us consider the following example (from Seaborn documentation): titanic = sns.load_dataset("titanic") fg = sns.catplot(x="age", y="embark_town", hue="sex", row="class", …
MarcoS
  • 13,386
  • 7
  • 42
  • 63
4
votes
1 answer

ggplot2: add horizontal line by group inside facet_grid

I want to draw a dot plot with horizontal lines by groups. The df object store the points and the df.line object stores the line I want to add to the dot plot. The horizontal lines are not the mean/median value of points, they are some standards I…
Lijia Yu
  • 90
  • 7
4
votes
1 answer

Plotting a reference line over facet plots

I need to scatter plot data with its own line by type with a comparison to a reference line for each facet. I am wrestling with getting the line equation y=8x+10 to plot on each facet plot. import pandas as pd import seaborn as sns …
4
votes
1 answer

ggplot2 facet labels - second line is not displayed

I have a script that used to produce a facetted plot with strip text on multiple lines. But this does not work anymore. Below is a MWE where the strip text should be parsed from, e.g. "bold(A)\nreally~long~extra" to: A really long extra The second…
bamphe
  • 328
  • 3
  • 12
4
votes
1 answer

xarray dataset: Faceted plotting over data variables (data_vars)

I'm a newbie here and also to xarray. I have xarray datasets (dimension: time,lat,lon) which contain several data variables (e.g. ModelA, ModelB) that have identical dimensions&coordinates and I want to make multipanel plots over all variables of…
angilaka
  • 41
  • 1
  • 1
4
votes
1 answer

facet_grid label_both wrap the label text dynamic facet variables in shiny plot

so I am struggling to get a plot working like I want. I have a facet_grid where the variables facetted is determined dynamically in a shiny app... facet_grid(facetFormula, labeller = label_both) where... facetFormula <-…
Alex
  • 55
  • 5
4
votes
1 answer

Python Seaborn FacetGrid different y-axis

I'm using sns.FacetGrid to plot 10 subplots. I'd like to flex the y-axis to be different for each subplot. At the moment it automatically uses the same for all subplots. Would it be possible to customize it to make it more specific for each subplot?
Dany
  • 43
  • 1
  • 3
4
votes
2 answers

ggplot - Centralize facet_grid title and appear only once

I've created a graph in ggplot with two variables inside facet_grid. I want the title of each facet to repeat only once and in the center of the facet. For example, the zeros and ones in the first raw (upper facet), will appear only once and in the…
DJV
  • 4,743
  • 3
  • 19
  • 34
4
votes
1 answer

Incorrect colour gradient when using cowplot to patch together plots

Say I have a data set with x and y values that are grouped according to two variables: grp is a, b, or c, while subgrp is E, F, or G. a has y values in [0, 1] b has y values in [10, 11] c has y values in [100, 101]. I'd like to plot y against x…
Dan
  • 11,370
  • 4
  • 43
  • 68
4
votes
3 answers

Alignment of y axis labels in faced_grid and ggplot?

By using ggplot and faced_grid functions I'm trying to make a heatmap. I have a categorical y axis, and I want y axis labels to be left aligned. When I use theme(axis.text.y.left = element_text(hjust = 0)), each panels' labels are aligned…
serdaryurek
  • 107
  • 6
4
votes
1 answer

Remove three sides of border around ggplot facet strip label

I have the following graph: And would like to make what I thought would be a very simple change: I would like to remove the top, right and bottom sides of the left facet label border lines. How do I do I remove those lines, or draw the equivalent…
Grubbmeister
  • 857
  • 8
  • 25