boxplot

Put stars on ggplot barplots and boxplots - to indicate the level of significance (p-value)

半世苍凉 提交于 2019-11-26 12:06:20
It's common to put stars on barplots or boxplots to show the level of significance (p-value) of one or between two groups, below are several examples: The number of stars are defined by p-value, for example one can put 3 stars for p-value < 0.001, two stars for p-value < 0.01, and so on (although this changes from one article to the other). And my questions: How to generate similar charts? The methods that automatically put stars based on significance level are more than welcome. Please find my attempt below. First, I created some dummy data and a barplot which can be modified as we wish.

R - ordering in boxplot

眉间皱痕 提交于 2019-11-26 09:47:56
问题 I am trying to produce a series of box plots in R that is grouped by 2 factors. I\'ve managed to make the plot, but I cannot get the boxes to order in the correct direction. My data farm I am using looks like this: Nitrogen Species Treatment 2 G L 3 R M 4 G H 4 B L 2 B M 1 G H I tried: boxplot(mydata$Nitrogen~mydata$Species*mydata$Treatment) this ordered the boxes alphabetically (first three were the \"High\" treatments, then within those three they were ordered by species name alphabetically

How to add a number of observations per group and use group mean in ggplot2 boxplot?

我与影子孤独终老i 提交于 2019-11-26 09:38:01
问题 I am doing a basic boxplot where y=age and x=Patient groups age <- ggplot(data, aes(factor(group2), age)) + ylim(15, 80) age + geom_boxplot(fill = \"grey80\", colour = \"#3366FF\") I was hoping you could help me out with a few things: 1) Is it possible to include a number of observations per group above each group boxplot (but NOT on the X axis where my group labels are) without having to do this in paint :)? I have tried using: age + annotate(\"text\", x = \"CON\", y = 60, label = \"25\")

Merge and Perfectly Align Histogram and Boxplot using ggplot2

匆匆过客 提交于 2019-11-26 09:10:33
问题 since yesterday I am reading answers and websites in order to combine and align in one plot an histogram and a boxplot generated using ggplot2 package. This question differs from others because the boxplot chart needs to be reduced in height and aligned to the left outer margin of the histogram . Considering the following dataset: my_df <- structure(list(id = c(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36

Labeling Outliers of Boxplots in R

南笙酒味 提交于 2019-11-26 09:00:47
问题 I have the code that creates a boxplot, using ggplot in R, I want to label my outliers with the year and Battle. Here is my code to create my boxplot require(ggplot2) ggplot(seabattle, aes(x=PortugesOutcome,y=RatioPort2Dutch ),xlim=\"OutCome\", y=\"Ratio of Portuguese to Dutch/British ships\") + geom_boxplot(outlier.size=2,outlier.colour=\"green\") + stat_summary(fun.y=\"mean\", geom = \"point\", shape=23, size =3, fill=\"pink\") + ggtitle(\"Portugese Sea Battles\") Can anyone help? I knew

Changing whisker definition in geom_boxplot

霸气de小男生 提交于 2019-11-26 05:29:21
问题 I\'m trying to use ggplot2 / geom_boxplot to produce a boxplot where the whiskers are defined as the 5 and 95th percentile instead of 0.25 - 1.5 IQR / 0.75 + IQR and outliers from those new whiskers are plotted as usual. I can see that the geom_boxplot aesthetics include ymax / ymin, but it\'s not clear to me how I put values in here. It seems like: stat_quantile(quantiles = c(0.05, 0.25, 0.5, 0.75, 0.95)) should be able to help, but I don\'t know how to relate the results of this stat to set

Plot multiple boxplot in one graph

梦想与她 提交于 2019-11-26 03:22:30
问题 I saved my data in as a .csv file with 12 columns. Columns two through 11 (labeled F1, F2, ..., F11 ) are features . Column one contains the label of these features either good or bad . I would like to plot a boxplot of all these 11 features against the label , but separate by good or bad . My code so far is: qplot(Label, F1, data=testData, geom = \"boxplot\", fill=Label, binwidth=0.5, main=\"Test\") + xlab(\"Label\") + ylab(\"Features\") However, this only shows F1 against the label . My

Put stars on ggplot barplots and boxplots - to indicate the level of significance (p-value)

帅比萌擦擦* 提交于 2019-11-26 02:29:37
问题 It\'s common to put stars on barplots or boxplots to show the level of significance (p-value) of one or between two groups, below are several examples: The number of stars are defined by p-value, for example one can put 3 stars for p-value < 0.001, two stars for p-value < 0.01, and so on (although this changes from one article to the other). And my questions: How to generate similar charts? The methods that automatically put stars based on significance level are more than welcome. 回答1: Please

JFreeChart scaling of Boxplots with several Categories

£可爱£侵袭症+ 提交于 2019-11-26 00:56:14
问题 i am currently working on a java-based project using JFreeChart to display boxplots. My Problem is how to display a chart containing boxplots for a CategoryDataset with about 20 Categories and 5+ Series. Currently if the preferred size of the ChartPanel is not set, the Legend, Labels and Annotations are readable but the Boxplots are too small. Or the size of the ChartPanel is set so that the Boxplots have an acceptable size but then the legend, labels and annotations are horizontally