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
9
votes
4 answers

How do I make my facets perfectly square?

I'm using facet_wrap with ggplot to create a plot of facets. My problem is that my facets always come out looking like very short, very wide rectangles, but I want them to be square so they are easier to understand. Ideally, I would like to…
andrew
  • 2,524
  • 2
  • 24
  • 36
9
votes
1 answer

When and how to use std::locale::messages?

The C++ standard defines six categories of facets: collate, ctype, monetary, numeric, time, and messages. I have known the usage of the first five, but I don't know when and how to use the last one: std::locale::messages. Any illustrative examples?
xmllmx
  • 39,765
  • 26
  • 162
  • 323
9
votes
2 answers

Vary the fill scale when using facet_wrap and geom_tile together

When using function geom_tile and facet_wrap together in ggplot2, how to set different limits of the aesthetic fill, as the option scales which can be set to be free/free_y/free_x in facet_wrap? The following is an example to show the problem. For…
nicolas.wong
  • 139
  • 1
  • 5
9
votes
1 answer

ggplot - facet by function output

I'm unsure how to facet by a function of the data in the data element of a ggplot object. In the following toy example, what I want to do is something like this: df <- data.frame(x=1:8, y=runif(8), z=8:1) ggplot(df, aes(x=x, y=y)) + geom_point() +…
Ken Williams
  • 22,756
  • 10
  • 85
  • 147
8
votes
3 answers

Solr multiple filter tagging / excluding

I am trying to apply filter tagging for Solr search Tagging_and_excluding_Filters. The challenge is to apply multiple tagging at the same time (for multiple select options on a single page). e.g.…
insightful
  • 189
  • 1
  • 5
  • 14
8
votes
2 answers

facet dynamic fields with apache solr

I have defined dynamic field in ApacheSolr: I use it to store products features like: color_feature, diameter_feature, material_feature and so on. Number of those fields are not constant becouse products are changing. Is it possible to get facet…
krinn
  • 882
  • 2
  • 10
  • 16
8
votes
4 answers

Does Solr have an API to read schema.xml?

Is there any Solr API to read the Solr schema.xml? The reason I need it is that Solr faceting is not backwards compatible. If the index doesn't define field A, but the program tries to generate facets for field A, all the facets will fail. Therefore…
Qing Zhang
  • 107
  • 3
  • 8
8
votes
4 answers

Using facet tags and strip labels together in ggplot2

I'd like to create a figure using ggplot2's facet_grid, like below: # Load ggplot2 library for plotting library(ggplot2) # Plot dummy data p <- ggplot(mtcars, aes(mpg, wt)) p <- p + geom_point() p <- p + facet_grid(gear ~ cyl) print(p) This is…
Dan
  • 11,370
  • 4
  • 43
  • 68
8
votes
0 answers

Can facets label be "merged" or combined?

I have the following code in R using the ggplot2 package to create a stacked bar plot. ggplot(example_data, aes(x = ID, y = amount, fill = Taxa)) + geom_bar(stat="identity", position = "fill") + facet_grid(.~City+Car+Color , scales = "free_x",…
nicole
  • 153
  • 1
  • 6
8
votes
2 answers

same area for all violins independent of facets in ggplot2

I want to create a plot for three different factors where all violins have the same area. But using facet_grid(. ~ C) seems to force the violins within each facet (i.e. just those within a level of factor C) to have the same area. How can I overcome…
statmerkur
  • 429
  • 3
  • 16
8
votes
2 answers

How to turn off project facets on eclipse?

I was trying to resolve a problem in my eclipse so I clicked on : Propreties -> Project Facets -> Click on the link Now I have a new view of Project Facets and a lot of errors and I don't know how to come back to the previous step and cancel this…
Chinovski
  • 497
  • 3
  • 7
  • 18
8
votes
1 answer

Adjusting the relative space of panels in a facet-grid/facet_wrap in ggplot2

Is there a way to change the heights/lengths of the y-axis for individual facets in a facet_grid or facet_wrap? For example, library(ggplot2) ggplot(economics_long[economics_long$variable %in% c("pop", "uempmed"),], aes(date, value)) + …
FXQuantTrader
  • 6,821
  • 3
  • 36
  • 67
8
votes
1 answer

Polar coordinate / circular layout for the whole facet_grid

I have a dataset with values 2 ordered discrete factors, with some corresponding continuous values. (random sample is generated below) randomData = expand.grid(1:5, 1:100) # The two discrete variables colnames(randomData) = c("index1",…
user5363218
8
votes
2 answers

ggplot2: More complex faceting

I have a heatmap that continues to become more and more complex. An example of the melted data: head(df2) Class Subclass Family variable value 1 A chemosensory family_1005117 caenorhabditis_elegans 10 2 A…
Nic
  • 113
  • 1
  • 1
  • 8
8
votes
2 answers

ElasticSearch - how to exclude filter from aggregations?

I have a filter query with 3 filters: "query": "iphone", color:5, category:10, brand:25. How can I get the number of products in each brand which has color:5 and category:10? In Solr I did it…
Alex Sharov
  • 154
  • 1
  • 9