boxplot

ggplot2: Boxplots with points and fill separation [duplicate]

ⅰ亾dé卋堺 提交于 2019-12-21 12:38:51
问题 This question already has answers here : ggplot2 - jitter and position dodge together (2 answers) Closed 2 years ago . I have a data which can be divaded via two seperators. One is year and second is a field characteristics. box<-as.data.frame(1:36) box$year <- c(1996,1996,1996,1996,1996,1996,1996,1996,1996, 1997,1997,1997,1997,1997,1997,1997,1997,1997, 1996,1996,1996,1996,1996,1996,1996,1996,1996, 1997,1997,1997,1997,1997,1997,1997,1997,1997) box$year <- as.character(box$year) box$case <- c

Python-Matplotlib boxplot. How to show percentiles 0,10,25,50,75,90 and 100?

不羁的心 提交于 2019-12-21 10:46:24
问题 I would like to plot an EPSgram (see below) using Python and Matplotlib. The boxplot function only plots quartiles (0, 25, 50, 75, 100). So, how can I add two more boxes? 回答1: I put together a sample, if you're still curious. It uses scipy.stats.scoreatpercentile, but you may be getting those numbers from elsewhere: from random import random import numpy as np import matplotlib.pyplot as plt from scipy.stats import scoreatpercentile x = np.array([random() for x in xrange(100)]) # percentiles

Get Quantile values from geom_boxplot()

China☆狼群 提交于 2019-12-21 05:07:58
问题 I'm using ggplot2 function geom_boxplot() to create boxplots of my data. Similarly to this question, I'd like to get the quantile values used for the creation of the boxplot, e.g., in a matrix. Is there a way to print out the values used within geom_boxplot()? 回答1: Probably the easiest way is to use an outside of ggplot aggregate, but here's how to do it with ggplot , using the function ggplot_build on a created plot: library(ggplot2) p <- ggplot(mtcars, aes(x=factor(gear), y=mpg)) + geom

Plotting multiple boxplots in seaborn?

China☆狼群 提交于 2019-12-21 04:12:23
问题 I want to plot boxplots using seaborn in pandas because it is a nicer way to visualize data, but I am not too familiar with it. I have three dataframes that are different metrics, and I want to compare the different metrics. I will loop through the file paths to access them. for path in paths: df = pd.read_csv(path) The dfs for each of the metrics are separate and look something like this (where the .... indicates filled in data values). 1, 2, 3, 4, 5 are the column names and indicate

Plot series of boxplots using base graphics in R

女生的网名这么多〃 提交于 2019-12-21 03:21:09
问题 I would like to plot multiple boxplots in R in a single graph and group them by pairs. I am a beginner in R and although several threads deal with the same subject (multiple boxplots in R ), I could not find a comprehensive way to to this. I would like to use base graphics only if possible. I have 10 sets of values, all of them containing 30 values (which can be any positive value). Within those 10 sets, 5 are of type 1 and the 5 other are of type 2. My objective is to have ten boxplots (one

How do I create a categorical scatterplot in R like boxplots?

拟墨画扇 提交于 2019-12-21 02:35:13
问题 Does anyone know how to create a scatterplot in R to create plots like these in PRISM's graphpad: I tried using boxplots but they don't display the data the way I want it. These column scatterplots that graphpad can generate show the data better for me. Any suggestions would be appreciated. 回答1: As @smillig mentioned, you can achieve this using ggplot2. The code below reproduces the plot that you are after pretty well - warning it is quite tricky. First load the ggplot2 package and generate

Best way to generate day-of-week boxplots from a Pandas timeseries

橙三吉。 提交于 2019-12-20 21:00:13
问题 i am trying to create a set of day-of-week boxplots for a timeseries (e.g. 5-minute temperature observations). My code: # ts is our timeseries ts = df.SomeColumn dow_map = {} days = ['MON','TUE','WED','THU','FRI','SAT','SUN'] dow_idx = ts.index.dayofweek i = 0 for d in days: dow_map[d] = ts[dow_idx == i] i = i + 1 df = pd.DataFrame(dow_map) df.boxplot() results in: --------------------------------------------------------------------------- Exception Traceback (most recent call last) <ipython

tick frequency when using seaborn/matplotlib boxplot

我们两清 提交于 2019-12-20 14:25:46
问题 I am plotting with seaborn a series of boxplots with sns.boxplot(full_array) where full_array contains 200 arrays. Therefore, I have 200 boxplots and ticks on the x-axis from 0 to 200. The xticks are too close to each other and I would like to show only some of them, for instance, a labeled xtick every 20, or so. I tried several solutions as those mentioned here but they did not work. Every time I sample the xticks, I get wrong labels for the ticks, as they get numbered from 0 to N, with unit

tick frequency when using seaborn/matplotlib boxplot

时光总嘲笑我的痴心妄想 提交于 2019-12-20 14:24:27
问题 I am plotting with seaborn a series of boxplots with sns.boxplot(full_array) where full_array contains 200 arrays. Therefore, I have 200 boxplots and ticks on the x-axis from 0 to 200. The xticks are too close to each other and I would like to show only some of them, for instance, a labeled xtick every 20, or so. I tried several solutions as those mentioned here but they did not work. Every time I sample the xticks, I get wrong labels for the ticks, as they get numbered from 0 to N, with unit

How to add a line in boxplot?

混江龙づ霸主 提交于 2019-12-20 10:34:45
问题 I would like to add lines between "mean" in my boxplot. My code: library(ggplot2) library(ggthemes) Gp=factor(c(rep("G1",80),rep("G2",80))) Fc=factor(c(rep(c(rep("FC1",40),rep("FC2",40)),2))) Z <-factor(c(rep(c(rep("50",20),rep("100",20)),4))) Y <- c(0.19 , 0.22 , 0.23 , 0.17 , 0.36 , 0.33 , 0.30 , 0.39 , 0.35 , 0.27 , 0.20 , 0.22 , 0.24 , 0.16 , 0.36 , 0.30 , 0.31 , 0.39 , 0.33 , 0.25 , 0.23 , 0.13 , 0.16 , 0.18 , 0.20 , 0.16 , 0.15 , 0.09 , 0.18 , 0.21 , 0.20 , 0.14 , 0.17 , 0.18 , 0.22 , 0