Questions tagged [facet]

Facetting is a technique for data visualization which makes it easier to compare groups inside your data.

Facet

In the ggplot2 package for R, creating subplots for groups of data is called facetting. When visualizing data, facetting allows groups of data to be rendered alongside each other in order to make it easier to compare them. A facetted plot can be made with facet_wrap() and facet_grid().

Resources

1763 questions
12
votes
3 answers

Combining new lines and italics in facet labels with ggplot2

I have a problem getting some words used in facet labels in italics. I use the following code to create new lines for the labels: levels(length_subject$CONSTRUCTION) <- c("THAT \n Extraposed", "THAT \n Post-predicate", "TO \n Extraposed \n…
user1504579
  • 227
  • 3
  • 8
12
votes
1 answer

Normalizing faceted histograms separately in ggplot2

My questions is similar to Normalizing y-axis in histograms in R ggplot to proportion but I'd like to add to it a bit. In general, I have 6 histograms in a 2x3 facet design, and I'd like to normalize each of them separately. I'll try to make a…
user1195564
  • 309
  • 1
  • 4
  • 11
12
votes
1 answer

Force X axis on both graphs in a facet grid when X values are the same

I have data with about 30 categories for the X axis in two groups for faceting. I will show this with some random data: dataf <- data.frame(x=c(1:30), A=rnorm(30,20,5), B=rnorm(30,15,0.5)) datam <- melt(dataf, id="x") ggplot(datam, aes(factor(x),…
MattLBeck
  • 5,701
  • 7
  • 40
  • 56
12
votes
1 answer

Ignore outliers in ggplot2 boxplot + faceting + "free" options

How can I adjust my Y axis in order to ignore outliers, like in this post, but in a more challenging case where I have 4 boxplots and a "free faceting" layout? p <- ggplot(molten.DF,aes(x=class,y=SOC,fill=class)) + geom_boxplot() + …
fstevens
  • 1,287
  • 1
  • 17
  • 28
11
votes
1 answer

How do i plot facet plots in pandas

This is what I have right now: np.random.seed(1234) test = pd.DataFrame({'week': [1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2], 'score': np.random.uniform(0, 1, 12), 'type': [0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1], …
collarblind
  • 4,549
  • 13
  • 31
  • 49
11
votes
2 answers

Add text on top of a faceted dodged bar chart

I'd like to plot a dodged barplot for two different years and put the revenue numbers on top of the bar accordingly. After trying quite some suggestion I found over here, I still can't quite get what I want (all the numbers were displayed in the…
Tung
  • 26,371
  • 7
  • 91
  • 115
11
votes
4 answers

Using facet_grid and facet_wrap Together

I'm trying to create a chart using facet_wrap with a facet_grid inside each of the wrapped facets but I'm unable to. Any suggestions? For example, if I'm doing year-on-year comparisons for monthly averages of 2 quantities, I would like to have - 2…
TheComeOnMan
  • 12,535
  • 8
  • 39
  • 54
11
votes
1 answer

Facet for continuous variables in ggplot2

Possible Duplicate: ggplot - facet by function output ggplot2's facets option is great for showing multiple plots by factors, but I've had trouble learning to efficiently convert continuous variables to factors within it. With data like: DF <-…
Señor O
  • 17,049
  • 2
  • 45
  • 47
10
votes
1 answer

what's the difference between grouping and facet in lucene 3.5

I found in lucene 3.5 contrib folder two plugins: one is grouping, the other is facet. In my option, both of them were used to split my documents into different categories. Why lucene has now two plugins for this?
mlzboy
  • 14,343
  • 23
  • 76
  • 97
10
votes
1 answer

Edit the Java Facet setting in eclipse

Some background: I'm getting the dreaded "Java compiler level does not match the version of the installed Java project facet" error in my eclipse project. I'm using Eclipse Helios on OS X Snow Leopard. I'm having trouble editing the java facet…
rwyland
  • 1,637
  • 3
  • 16
  • 30
10
votes
1 answer

ggplot add ticks to each plot in a facet_wrap

I'd like to display x-axis ticks on plots in the upper rows in facet_wraps. For example: library(ggplot2) ggplot(diamonds, aes(carat)) + facet_wrap(~ cut, scales = "fixed") + geom_density() generates this plot: I'd like to have ticks as I've…
conor
  • 1,204
  • 1
  • 18
  • 22
10
votes
1 answer

How to apply separate coord_cartesian() to "zoom in" into individual panels of a facet_grid()?

Inspired by the Q Finding the elbow/knee in a curve I started to play around with smooth.spline(). In particular, I want to visualize how the parameter df (degree of freedom) influences the approximation and the first and second derivative. Note…
Uwe
  • 41,420
  • 11
  • 90
  • 134
10
votes
4 answers

SOLR - How to have facet counts restricted to rows returned in resultset

/select/?q=*:*&rows=100&facet=on&facet.field=category I have around 100 000 documents indexed. But I return only 100 documents using rows=100. The facet counts returned for category, however return the counts for all documents indexed. Can we…
user489895
  • 131
  • 1
  • 10
10
votes
3 answers

ggplot2: How to force the number of facets with too few plots?

To plot 9 histograms per ggplot graph I used the following data : id variable value 1 Segment III | RIM BlackBerry Pearl | 5.600000 2 Display size | RIM…
Yohan Obadia
  • 2,552
  • 2
  • 24
  • 31
10
votes
0 answers

Elasticsearch aggregations multifaceted navigation, excluding facets by group

I'm pretty new to ES and have been trying to implement faceted navigation in the same way most of the large e-commerce stores do. Part of my products mapping looks like this: 'name' => [ 'type' => 'string', 'analyzer' =>…