facet

Only show one variable label in facet_wrap strip text?

空扰寡人 提交于 2020-01-24 19:18:07
问题 I am plotting multiple graphs using facet_wrap() from the ggplot2 package in R . When facetting by multiple variables, the result includes both labels in the strip text. How can I remove one? In this toy example from the mpg dataset, how to keep the cyl labels only? Thanks ggplot(mpg, aes(displ, hwy)) + geom_point() + facet_wrap(c("cyl", "drv")) 回答1: The biggest concern with this is as @aelwan mentioned several plots will have the same strip labels but are not the same. Ignoring this issue, I

Deserialization of non-finite floating-point numbers fails even with appropriate facets

余生颓废 提交于 2020-01-23 14:08:23
问题 I need to use Boost.Serialization to serialize floating-point numbers. Since NaN and infinites cannot natively be read from an input stream, I am trying to use the facets in boost/math/special_functions. I have tested them on my platform using code similar to the examples we can find here: http://www.boost.org/doc/libs/1_50_0/libs/math/doc/sf_and_dist/html/math_toolkit/utils/fp_facets/intro.html However, the following code still fails to properly unserialize non-finite floating point values

overlapping and fixing x-scales in facet (scale=“free”) in order to make a film

梦想与她 提交于 2020-01-23 13:26:25
问题 With the help of @Justin on another post, I plotted simulation result with the facet_grid option in ggplot2. The post with data and answer is here: Use facet_grid option to plot column of dataframe with ggplot2 Here a copy of original sample data with added information about scale_x min and max values for each parameter type : dat <- read.table(textConnection("P1 P2 P3 P4 R 1 2e-5 1.0 0.6 3 1 2 4e-6 1.5 0.7 1.5 2 3 6e-7 1.2 0.6 2.5 3 4 8e-8 1.45 0.65 3.2 4 ")) scalx <- read.table

Changing the breaks and limits in a facet_grid where scales=“free_y”

荒凉一梦 提交于 2020-01-23 12:22:45
问题 Is possible to control separately the limits and the breaks of a given axis ( x of y ) when the facet_grid uses the `scales="free_smth" parameter? I have a plot where I have used `facet_grid(scales="free_y") because the faceted data are of different orders of magnitude. Now I would like to control separately the limit of the y axis for each of those grids: for example make each of the y axis 10% longer? Is there a way to achieve that? For the breaks I found this post: Change the number of

Plotly Facets not translating properly

不想你离开。 提交于 2020-01-21 23:56:59
问题 I've found that with Plotly with R, when I'm faceting plots, they often don't translate properly from R to Plotly. For example, my graph plotted in R looks like so: When I send it to plotly, it looks like so: (Some data has been hidden from both plots for confidentiality reasons) My code looks like so: plot <- ggplot(sytoxG_data_no_NC) + geom_ribbon(data = confidence_intervals_SG, mapping = aes(x = time_elapsed, ymin = phenotype_value.NC.lower, ymax = phenotype_value.NC.upper, fill = "red",

Plotly Facets not translating properly

江枫思渺然 提交于 2020-01-21 23:55:27
问题 I've found that with Plotly with R, when I'm faceting plots, they often don't translate properly from R to Plotly. For example, my graph plotted in R looks like so: When I send it to plotly, it looks like so: (Some data has been hidden from both plots for confidentiality reasons) My code looks like so: plot <- ggplot(sytoxG_data_no_NC) + geom_ribbon(data = confidence_intervals_SG, mapping = aes(x = time_elapsed, ymin = phenotype_value.NC.lower, ymax = phenotype_value.NC.upper, fill = "red",

Plotly Facets not translating properly

╄→гoц情女王★ 提交于 2020-01-21 23:55:09
问题 I've found that with Plotly with R, when I'm faceting plots, they often don't translate properly from R to Plotly. For example, my graph plotted in R looks like so: When I send it to plotly, it looks like so: (Some data has been hidden from both plots for confidentiality reasons) My code looks like so: plot <- ggplot(sytoxG_data_no_NC) + geom_ribbon(data = confidence_intervals_SG, mapping = aes(x = time_elapsed, ymin = phenotype_value.NC.lower, ymax = phenotype_value.NC.upper, fill = "red",

Plotly Facets not translating properly

≯℡__Kan透↙ 提交于 2020-01-21 23:55:05
问题 I've found that with Plotly with R, when I'm faceting plots, they often don't translate properly from R to Plotly. For example, my graph plotted in R looks like so: When I send it to plotly, it looks like so: (Some data has been hidden from both plots for confidentiality reasons) My code looks like so: plot <- ggplot(sytoxG_data_no_NC) + geom_ribbon(data = confidence_intervals_SG, mapping = aes(x = time_elapsed, ymin = phenotype_value.NC.lower, ymax = phenotype_value.NC.upper, fill = "red",

Highlight data individually with facet_grid in R

☆樱花仙子☆ 提交于 2020-01-21 11:13:28
问题 I am using facet_grid in R to plot RT data for 5 different groups. I would like to highlight the data between 5 and 95% for each group. With the code below, I am using the percentile of the entire data frame, not the one for each group. Any idea of how I can still use facet_grid and have the unique percentile of each group highlighted in the plot. rect <- data.frame (xmin=quantile(ss$RT, c(0.05)), xmax=quantile(ss$RT, c(0.95)), ymin=-Inf, ymax=Inf) qplot(prevRT, RT, group=ss, color = prim,

facet wrap distorts state maps in R

早过忘川 提交于 2020-01-15 23:25:23
问题 This question is an extension of a previous question I asked, see Mapping different states in R using facet wrap. I want to display points in the maps, colored by their value. I can get this to work using the following code, which produces a decent looking plot, but I like the look of the 'sepStates' output that Mark Peterson provided better. mn <- min(test$value); hist(test$value) mx <- max(test$value) ggplot(map_data('state',region=states), aes(x=long,y=lat,group=group)) + geom_polygon