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
8
votes
2 answers

overriding ctype

I'm writing a lambda calculus interpreter for fun and practice. I got iostreams to properly tokenize identifiers by adding a ctype facet which defines punctuation as whitespace: struct token_ctype : ctype { mask t[ table_size ]; …
Potatoswatter
  • 134,909
  • 25
  • 265
  • 421
8
votes
1 answer

geom_text writing all data on all facets

I used ggplot with facet_grid and I'd like to indicate on each facet the number of observations in each facet. I follow examples provided on many sites but when I get it to write anything, it writes all four observation numbers on top of each other…
Joseph Kreke
  • 667
  • 1
  • 7
  • 18
8
votes
1 answer

Faceting with Solr using "string" fields, "text" fields and "copy" fields

I have a problem with Solr and Faceting and wondering if anyone knows of the fix. I have a work around for it at the minute, however i really want to work out why my query isn't working. Here is my Schema, simplified to make it easier to…
CraftyFella
  • 7,520
  • 7
  • 47
  • 61
8
votes
2 answers

Colouring points by factor within the margin of a faceted ggplot2 plot in R

I'd like to create a faceted plot with margins in ggplot2. However, I'd like the margin plot to have colours according to from which facet the particular point has been derived. It's probably best illustrated with an example: library(ggplot2) p <-…
AnjaM
  • 2,941
  • 8
  • 39
  • 62
8
votes
2 answers

ggplot2 + aes_string inside a function via formula interface

Interactively, this example works fine: p <- ggplot(mtcars, aes(mpg, wt)) + geom_point() p + facet_grid(. ~ vs) Now, make a function with a formula interface and use aes_string to do this same thing, and it doesn't work (error is: Error in…
Bryan Hanson
  • 6,055
  • 4
  • 41
  • 78
8
votes
3 answers

Filter irrelevant facets from Solr results

I've spent hours poking around for a solution to my problem. I've seen people ask questions close to what I'm trying to accomplish, but so far no one seems to be asking the same question. Let me see if I can explain this adequately: Say I'm a shoe…
SeanH
  • 317
  • 5
  • 9
7
votes
1 answer

How to use Multi-Value Attributes (MVA) and facets together in Thinking Sphinx?

I've got rails 3 app with models: class Event < ActiveRecord::Base has_many :event_categories has_many :categories, through: :event_categories end class EventCategory < ActiveRecord::Base belongs_to :category belongs_to :event end class…
Nikolay Shebanov
  • 1,363
  • 19
  • 33
7
votes
3 answers

Combine multiple facet strips across columns in ggplot2 facet_wrap

I am trying to combine facet strips across two adjacent panels (there is always two adjacent ones with the same first ID variable, but with two different scenarios, let's call them "A" and "B"). I am not particularly wedded to the gtable + grid…
Björn
  • 644
  • 10
  • 23
7
votes
1 answer

ggplot2 facet_grid with facet titles

Is there a canonical way to add facet titles within facet_grid? Or a way to specific row labels in facet_wrap? (Without geom_text, geom_label, or grob manipulation.) Consider: dat <- data.frame(rowInd = paste0("R", c(1, 2, 2, 3, 3, 3)), colInd =…
r2evans
  • 141,215
  • 6
  • 77
  • 149
7
votes
1 answer

How to add superscripts to facet labels

I am trying to plot three variables and want the units in the axes labels but can't find a way to label them properly in facets with the superscripts. I've tried as_labeller, label_bquote, expression/paste and changing the original data. p <-…
emjbar
  • 73
  • 1
  • 3
7
votes
2 answers

Get same height for plots having different facet numbers, and coord_fixed?

Let me explain in pictures what I mean: set.seed(1) ## dummy data.frame: df <- data.frame( value1 = sample(5:15, 20, replace = T), value2 = sample(5:15, 20, replace = T), var1 = c(rep('type1',10), rep('type2',10)), var2 =…
tjebo
  • 21,977
  • 7
  • 58
  • 94
7
votes
2 answers

Javascript Faceted Search Client (Framework)

I wonder if there's any javascript framework (client-side stuff) to manage search results UI in a facet-based way (with facet generation, counting for items matching that facet..). In other words, something like Ajax Solr (the old SolrJS), but not…
lucke84
  • 4,516
  • 3
  • 37
  • 58
7
votes
1 answer

Is it possible to avoid axis label overlapping by ggrepel?

I am drawing heatmap with ggplot2. Several ticks on y axis need to be labeled. However,some of them are too close and overlap. I know ggrepel could separate text labels, but currently I have not worked out for my problem. My code is as following.…
PengY
  • 73
  • 1
  • 4
7
votes
1 answer

Subplot/facets with wordclouds

I'm trying to make subplots/facets of several wordclouds in a way that's pleasing to the eye. Problems: I can't get base R to combine wordcloud-outputs properly making wordclouds with ggplot2 allows for facetting but yields unsatisfactory results …
ulima2_
  • 1,276
  • 1
  • 13
  • 23
7
votes
2 answers

Boxplots with Wilcoxon significance levels, and facets, show only significant comparisons with asterisks

Following up on this question and for the sake of completeness, I modified the accepted answer and customized the resulting plot, but I am still facing some important problems. To sum up, I am doing boxplots reflecting significance of Kruskal-Wallis…
DaniCee
  • 2,397
  • 6
  • 36
  • 59