facet

Force x-axis labels on facet_grid ggplot: x-axis labels differ per row

五迷三道 提交于 2019-12-19 09:03:18
问题 I was so happy to find the greater part of a solution to my question in the post, "Force X axis text on for all facets of a facet_grid plot" . I'd like to create a graph to look somewhat like the OP Drew Steen's, except I have more than two rows of facets, and I'd like to make the x-axes labels different for each row. I made a super-hacky solution out of @baptiste's awesome answer (mostly because I am unfamiliar with the gtable package), and I'd like to know: If there is a more elegant

facet dynamic fields with apache solr

僤鯓⒐⒋嵵緔 提交于 2019-12-19 06:18:23
问题 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 result for all those dynamic fields with the same query or do I need to write always all fields in a query like ... facet.field=color_feature&facet.field=diameter_feature&facet.field=material_feature&facet.field= ... 回答1: Solr currently does not

Mapping different states in R using facet wrap

荒凉一梦 提交于 2019-12-19 04:25:47
问题 I am trying to use facet_wrap in ggplot2 to map a different state into each facet of a multi-faceted plot. My code is listed here, where 'dataset' is a data frame containing a variable named 'state', which contains the names of the different states I want mapped by facet. library(maps) library(ggplot2) states <- c('Oklahoma','Arizona','Washington','North Dakota','Michigan','Florida') map <- ggplot(data=datatest) + geom_polygon(data=map_data ('state',region=datatest$state),aes (x=long,y=lat

Different geom_rect() objects for facets

我是研究僧i 提交于 2019-12-18 16:34:08
问题 I have a dataframe which I've used to create a ggplot object faceted into three separate plots. max_24h_lactate_cpet.long First_24h_Lactate_Max, Lactate_Above_Threshold, Metric, Value 2.3, High, AT_VO2_mL.kg.min, 17.00 2.3, High, VO2_Peak, 84.07 2.3, High, AT_VE_VCO2, 35.00 In dput format: dput(max_24h_lactate_cpet.long) structure(list(First_24h_Lactate_Max = c(2.3, 2.3, 2.3), Lactate_Above_Threshold = structure(c(1L, 1L, 1L), .Label = c("High", "Normal"), class = "factor"), Metric =

How to let <f:facet> contain multiple components? It shows only the first

怎甘沉沦 提交于 2019-12-18 11:29:47
问题 I use <f:facet> to create a table header and I want a symbol beside it. However, it doesn't seem to work well. The symbol is not rendered. JSF: <h:column id="subject_column"> <f:facet name="header"> <h:commandLink value="Subject" id="sort_by_subjects" action="#{xxx.sort}"> <f:param id="sortBySubject" name="sortBy" value="SUBJECT"/> </h:commandLink> <span>${isAscending}</span> </f:facet> <h:outputText value="#{email.emailSubject}"/> </h:column> ${isAscending} contains the arrow symbol ↑ and

How to adjust facet size manually

穿精又带淫゛_ 提交于 2019-12-18 11:25:24
问题 I have a faceted plot with very diverse data. So some facets have only 1 x value, but some others have 13 x values. I know there is the parameter space='free' which adjusts the width of each facet by the data it represents. My question, is there a possibility to adjust this space manually? Since some of my facets are so small, it is no longer possible to read the labels in the facets. I made a little reproducible example to show what I mean. df <- data.frame(labelx=rep(c('my long label',

Elasticsearch - generic facets structure - calculating aggregations combined with filters

 ̄綄美尐妖づ 提交于 2019-12-18 10:32:11
问题 In a new project of ours, we were inspired by this article http://project-a.github.io/on-site-search-design-patterns-for-e-commerce/#generic-faceted-search for doing our “facet” structure. And while I have got it working to the extent the article describes, I have run into issues in getting it to work when selecting facets. I hope someone can give a hint as to something to try, so I don’t have to redo all our aggregations into separate aggregation calculations again. The problem is basically

How to position annotate text in the blank area of facet ggplot

主宰稳场 提交于 2019-12-18 08:29:25
问题 How to annotate some text in the blank space within a odd numbered faceted ggplot. Lets have a faceted ggplot with data as below with with 2 rows and 2 columns. So there is blank space in place of 2 row, 2nd column. df<- data.frame(Ara = rep("XTX", each = 3), Len = c(744, 750, 755), Mon = c("Sep", "Oct","Nov"), Value=c(11.224,10.15,4.23)) df facetplot<-ggplot(df, aes(x=Value, y=Len, shape=Ara))+ geom_point(size=5.0)+ theme(legend.position = c(.7, .4), legend.direction="vertical")+ facet_wrap(

'Labels on top' with facet_grid, or 'space option' with facet_wrap

ぐ巨炮叔叔 提交于 2019-12-18 07:45:05
问题 facet_grid allow me to size each facet width according to number of items on y axis ( space argument): df <- data.frame(label = c("Variable one", rep("Variable two", 2), rep("Variable three", 3)), item = c("A", "B", "C", "D", "E", "F"), value = rnorm(6)) ggplot(df, aes(x = value, y = item)) + geom_point() + facet_grid(label ~ ., scales = "free_y", space = "free_y") + ylab("") + theme(strip.text.y = element_text(angle=0)) But I would like facet labels on top, so I switch to facet_wrap , and

Variable hline in ggplot with facet

夙愿已清 提交于 2019-12-17 19:55:04
问题 Using the Iris data set as an example, I can produce a ggplot with facet. The code is: library(ggplot2) data(iris) y=iris y$Petal.Width.Range=factor(ifelse(y$Petal.Width<1.3,"Narrow","Wide")) y$Petal.Length.Range=factor(ifelse(y$Petal.Length<4.35,"Short","Long")) ggplot(y, aes(Sepal.Length,Sepal.Width)) + geom_point(alpha=0.5)+ geom_hline(yintercept =3 ,alpha=0.3)+ facet_grid(Petal.Width.Range ~ Petal.Length.Range) Here I have a horizontal spec of 3 in each of the 4 cases. What should I do if