facet-grid

Remove three sides of border around ggplot facet strip label

橙三吉。 提交于 2020-02-04 01:26:30
问题 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 of the right hand lines? I would rather not muck about with grobs, if possible, but won't say no to any solution that works. Graph code: library(ggplot2) library(dplyr) library(forcats) posthoc1 %>% mutate(ordering = -as.numeric(Dataset) + Test.stat,

Remove three sides of border around ggplot facet strip label

廉价感情. 提交于 2020-02-04 01:26:30
问题 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 of the right hand lines? I would rather not muck about with grobs, if possible, but won't say no to any solution that works. Graph code: library(ggplot2) library(dplyr) library(forcats) posthoc1 %>% mutate(ordering = -as.numeric(Dataset) + Test.stat,

ggplot2 facet_grid with distinct x-axis labels using facet_grid

北城余情 提交于 2020-01-14 03:17:45
问题 I've been stuck on this issue for a long time. Basically I need to generate stacked bar plots of bacterial taxa in a 2 dimensional facet_grid. This is not a problem - however, I do need to use 2 different x-axis labels plots. I've looked at these threads which help, but still not satisfying: Force x-axis labels on facet_grid ggplot: drop lables Force x-axis labels on facet_grid ggplot: x-axis labels differ per row Force X axis text on for all facets of a facet_grid plot My first data frame:

How to increase the inner margin of a ggplot boxplot in facet_grid?

与世无争的帅哥 提交于 2020-01-05 16:12:45
问题 I am setting up boxplots to present these in a ggplot2 facet_grid and I would like to increase the inner margin. Unfortunately, I am not able to increase the distance to the frame of the facet. How could I increase the inner margin (left and right) as indicated by the blue arrows? require(ggplot2) dat <- rbind(data.frame(approach=1,product=1,value=seq(1,20,0.5)), data.frame(approach=1,product=2,value=seq(5,15,0.3)), data.frame(approach=1,product=3,value=seq(5,17,0.2)), data.frame(approach=2

How to increase the inner margin of a ggplot boxplot in facet_grid?

我的梦境 提交于 2020-01-05 16:12:21
问题 I am setting up boxplots to present these in a ggplot2 facet_grid and I would like to increase the inner margin. Unfortunately, I am not able to increase the distance to the frame of the facet. How could I increase the inner margin (left and right) as indicated by the blue arrows? require(ggplot2) dat <- rbind(data.frame(approach=1,product=1,value=seq(1,20,0.5)), data.frame(approach=1,product=2,value=seq(5,15,0.3)), data.frame(approach=1,product=3,value=seq(5,17,0.2)), data.frame(approach=2

Force x-axis labels on facet_grid ggplot: drop lables

萝らか妹 提交于 2020-01-04 08:28:04
问题 These questions follow up on the previous posts: Force X axis text on for all facets of a facet_grid plot Force x-axis labels on facet_grid ggplot: x-axis labels differ per row I'm just starting to learn gtable . I merged the code from the above two posts to get the x-axes on each panel of the facet grid. library(ggplot2) diamondSub <-subset(diamonds, (cut=="Ideal" | cut=="Premium" | cut == "Very Good") & (color=="E" | color=="I")) p <- ggplot(diamondSub, aes(x=clarity, y=price)) + geom_blank

Force x-axis labels on facet_grid ggplot: drop lables

ぃ、小莉子 提交于 2020-01-04 08:28:04
问题 These questions follow up on the previous posts: Force X axis text on for all facets of a facet_grid plot Force x-axis labels on facet_grid ggplot: x-axis labels differ per row I'm just starting to learn gtable . I merged the code from the above two posts to get the x-axes on each panel of the facet grid. library(ggplot2) diamondSub <-subset(diamonds, (cut=="Ideal" | cut=="Premium" | cut == "Very Good") & (color=="E" | color=="I")) p <- ggplot(diamondSub, aes(x=clarity, y=price)) + geom_blank

Seaborn FacetGrid PointPlot Add 1 Grid Line

醉酒当歌 提交于 2020-01-03 19:15:29
问题 Given the following: import seaborn as sns attend = sns.load_dataset("attention") sns.set_style("whitegrid", {'axes.grid' : False,'axes.edgecolor':'none'}) g = sns.FacetGrid(attend, col="subject", col_wrap=5, size=1.5, ylim=(0, 10)) ax = g.map(sns.pointplot, "solutions", "score", scale=.7) As you can see, I have removed all grid lines. I would now like to add just one horizontal grid line: at the value of 5 on the y-axis for each plot. Is this possible to do? I looked into the set_style

Move axis labels in between plot and facet strip

梦想的初衷 提交于 2020-01-02 03:45:08
问题 I am trying to move the facet strip to the far left of my plot, so that the labels sit adjacent to the bars, and the grouping strips sit to their left (see my example below). I assume this must be done with Grobs, but I have little experience with that level of manipulation and would appreciate guidance. Data: structure(list(dept = structure(c(2L, 2L, 2L, 2L, 2L, 2L, 2L, 1L, 1L, 1L, 1L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 1L, 1L, 1L, 1L, 5L, 5L, 5L, 5L, 5L, 5L,

Repeating x axis labels for all facets using FacetGrid in seaborn

北城余情 提交于 2020-01-01 05:28:11
问题 I am working with the FacetGrid example presented here that results in the plot below. In my data set, there is quite a lot of plots, and it would be convenient to have the x axis labels repeated for each facet, not only at the bottom. For this example, the values 62, ..., 76 should be repeated for each of the A-J facets. 回答1: The answer by Bazingaa works for matplotlib version 2.0.2. For newer versions of matplotlib, using ax.tick_params() and setting labelbottom=True seems to work: for ax