3,453 questions
1
vote
1
answer
55
views
Boxplot with scatter points: preventing overlap when categories are similar
I am trying to create a boxplot with different categories and overlay scatter points on top of it. The problem I am encountering is that when the results across categories are very similar, the ...
2
votes
2
answers
105
views
Jitter points next to boxplot [duplicate]
Is there a way to plot all points as a jitter next to (not underneath or on top) of a box plot in ggplot2? I can move the points to one side or change the width of jitter, but not both.
Edit: Using ...
2
votes
1
answer
59
views
Making matplotlib boxplot include columns with NaN values
I've been trying to plot a data frame as a box plot using matplotlib. My data frame looks something like this:
9-1 9-2 9-3 9-4 9-5
0 23 16.0 18.0 18.0 26
1 27 18.0 20.0 17.0 33
...
3
votes
1
answer
117
views
How to set the width of boxplots with custom quantiles?
For these boxplots with custom y quantiles and centered on the medians x_q50, how to set their width based on given x quantiles (e.g. based on x_min and x_max, or x_q025 and x_q975...), while having ...
2
votes
2
answers
90
views
Formatting my boxplots with correct labels
I have 6 boxplots. 2 rows, three columns. Here are my boxplots so far:
I want to format my boxplots so that the top and bottom graph shares one Y-axis label. Both x-axis labels should move to the far ...
1
vote
2
answers
86
views
Creating (ggplot2-)boxplots based on integer x values with correct spacing on the x axis
I am trying to visualize my benchmarking results where for three values of the discrete hyperparameter p and two values of categorical hyperparameter q, I have 50 runtimes. I am trying to create a ...
-3
votes
1
answer
71
views
How do I make a chart in R with whiskers and a circle for lab value and MPV (not quite a box plot)? [closed]
I am trying to recreate the graph below in R. It is showing the results of 1 lab and comparing it to the MPV (most probable value) that is calculated with multiple labs. The lab value is the colored ...
0
votes
0
answers
13
views
Inserting xticks in seaborn boxplot [duplicate]
I have a boxplot as shown in the picture.
I would like to have a continuous x-axis from 1 to 27. For example, between the boxplot x=10 and x=12 the xtick 11 must be inserted with a corresponding ...
1
vote
1
answer
70
views
boxplot across multiple columns in R
I'm new to R and having next to nothing experience with it I'm struggling with what may be a pretty easy problem. I have a dataset of acceptability judgments provided by a group of 30 participants on ...
0
votes
1
answer
51
views
Maplotlib BoxPlot Facecolor by quartile
I am using the example from the docs (with a slightly modified data structure):
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
data = pd.DataFrame({"peaches":[1,4,7,...
1
vote
2
answers
110
views
how do I combine two box plots onto a single plot in r
I have two groups of data corresponding to a duplicated gene. I would like to plot these data using an interaction box plot, and have been unable to get a version that does what I want. The closest I ...
4
votes
2
answers
76
views
In pandas, a groupby followed by boxplot gives KeyError: "None of [Index(['A', 1], dtype='object')] are in the [index]"
This very simple script gives error KeyError: "None of [Index(['A', 1], dtype='object')] are in the [index]":
import pandas as pd
import matplotlib.pyplot as plt
L1 = ['A','A','A','A','B','B'...
0
votes
0
answers
36
views
matplotlib/pandas multiple boxplots with an additional subplot
I would like to create 5 boxplots from a pandas dataframe and add an additional plot with a bar chart to create a full 3x2 matrix of plots. However, I am getting an error in several approaches.
Try #1:...
1
vote
1
answer
61
views
Plot pandas groupby boxplot and dataframe plot in the same figure
Why the script below does not work? How can I match the groupby boxplot and the DataFrame plot in the same figure?
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
fig, axes = ...
1
vote
0
answers
30
views
Problem with sns boxplot and the hatch pattern
I have this code
#Plot
# Define a custom palette for the strains
custom_palette = {
'H9CK': 'green',
'H9RT': 'blue',
'H9TK': 'red',
'H9WD': 'orange'
}
...
0
votes
1
answer
56
views
Adjusting the scale on ggplot
I'm creating some box plots with geom_boxplot and geom_jitter in ggplot2. For the most part, my data points are clustered around the boxes, but there are a few that aren't. I'm not removing them as ...
0
votes
1
answer
221
views
Adding compact letter display to a geom_boxplot
I would like to add a compact letter display result to a geom_boxplot. The CLD is generated from a post-hoc dunn test. I'd like to add the letters above the whiskers, the same as would be done with ...
0
votes
0
answers
24
views
Stacked boxplot [duplicate]
I am trying to create a stacked boxplot where each row represents a city and each column a land use (LU). Also, I want each pair of boxplots to have it's own range on the y-axis much like the one in ...
0
votes
0
answers
22
views
Is there a way to fix a boxplot that is showing up as lines rather than boxes. Never had an issue before?
ggplot(mean_mercury_by_tissue,aes(x=tissue,y=mean_concentration))+geom_boxplot
I have calculated mean mercury for each tissue which has generated a new table of data but the data is showing as one ...
1
vote
1
answer
74
views
Boxplots with gnuplot - coloring each individual plot
I am trying to color each individual box plot separately, but I am struggling to figure out how to modify my gnuplot script. Any help is appreciated! Here is my code:
set terminal pngcairo enhanced ...
0
votes
0
answers
47
views
How can I filter outliers in data that is manually recorded?
Different people have to write down values on a certain type of parameter in order to fill out a table, and people obviously tend to write wrong. Sometimes, by a factor of 1000. This creates a lot of ...
0
votes
0
answers
69
views
ggplot's geom_boxplot(outlier.size = NA, position = position_dodge(width = 0.8)) Outlier not ommitted and Position Dodge does not work
I am working on a data visualization in R Shiny where I aim to display the spread of avg_speed for each hour of the day using boxplots. My goal is to represent each road as a separate boxplot within ...
2
votes
1
answer
53
views
How do I represent sided boxplot in seaborn when boxplots are already grouped?
I'm seeking for a way to represent two sided box plot in seaborn.
I have 2 indexes (index1 and index2) that I want to represent according to two information info1 (a number) and info2 (a letter)
My ...
1
vote
1
answer
57
views
plot horizontal cutoff lines on top of boxplots
I have a violin+boxplots plot I do with the iris data as an example, like this:
data(iris)
iris_long <- as.data.frame(tidyr::pivot_longer(iris, -Species, names_to = "variable", values_to =...
0
votes
1
answer
49
views
Aligning data in circular boxplots with grey concentric circles
I spent some time trying to modify the following code so that the data for each variable aligns with each grey concentric circle.
This is my last post (Adding grey concentric circles to circular ...
0
votes
1
answer
54
views
Plotting two variables in a boxplot ggplot2
I understand that others have asked this question and I have read and attempted the answers that people have provided, but I'm still not having luck. My R literacy isn't high enough yet and maybe ...
1
vote
1
answer
58
views
Adding grey concentric circles to circular boxplot background [duplicate]
I have generated a rather complicated plot and need guidance on it's aesthetics. The plot I've generated is "Plot #1" below. I would like to add the grey concentric background circles (not ...
0
votes
1
answer
39
views
Coloring the dots in a boxplot according to a variable not included in the boxplot in R
I'm trying to add color to the dots of a boxplot in R based on a variable not included in the boxplot. The other variable is a continuous variable, but it could be grouped as a character or factor ...
0
votes
1
answer
64
views
is there a way to only display dots for individual data points on a boxplot if they are above/below a certain range?
I would like to create a boxplot for my data where the boxplot itself represents the IQR and the whiskers represent the 5th to 95th percentile values. I want to use geom_dotplot to only show the ...
0
votes
2
answers
69
views
How to make this boxplot unsquished, so that you can see the whiskers on both sides?
I am super new to R and am trying to complete a class assignment and need to make a boxplot but I cannot figure out how to make it so this boxplot isn't squished and unable to read.
This is my current ...
-2
votes
1
answer
44
views
Adding Comparison Annotations to Boxplots [closed]
Boxplot with Tukey Comparison Bars
I had run an ANOVA test and found that at least one of the means among my groups were statistically significantly different. As follow-up analysis, I ran a Tukey ...
2
votes
1
answer
213
views
Adding significance bars in a ggplot2() boxplot between two groups in the same x value
I am using the built-in ToothGrowth dataset as toy data to make boxplots with the package ggplot2, and am also trying to add significance bars. I got it working using the package ggpubr, where I ...
-1
votes
1
answer
85
views
show a data point on boxplot of pandas dataframe
I'm simulating the results of a paper and need to show a data point on boxplot of a pandas dataframe. the image of the corresponding paper is like this:
i tried to plot the boxplot using df.boxplot , ...
0
votes
2
answers
79
views
Matplotlib boxplots displayed with constant width
I'm plotting boxplots that are positioned very far apart on the X axis. I'd like to be able to zoom in and out on this graph and have the different boxplots displayed with the same width, independent ...
2
votes
1
answer
49
views
How to increase size of group names in boxplot
I have a dataset with two variables, one with numeric and one with categorical data, such as this
df <- data.frame(c(1, 2, 3, 4, 5, 6), c("red", "red", "red", "...
1
vote
1
answer
53
views
edit plot attributes manually and redraw
I would like to change the way base boxplot function displays my data.
I would like to have the interdeciles as my whiskers instead of what boxplot is currently do now (min-max or the interquartile ...
0
votes
0
answers
30
views
Replace median line with mean in box plot (ggplot2) [duplicate]
I know how to add a mean line on top of a box plot with stat_summary, but I would like to remove the median line altogether and just have the mean show in the box plot instead.
Minimal example:
ggplot(...
2
votes
1
answer
43
views
Boxplot: How to convert x-axis to continuous value scale?
How can I convert the x-axis to have continuous values. In the proposed example, I would like to have the boxplot at 0 away from those associated with 2.5 and 3. I don't want to have 3 equidistant ...
0
votes
2
answers
53
views
Given two columns with the same name how can I plot two boxplots side by side over the same name in R?
I have a problem with ggplot. Assuming I have the dataframe 'df_temp' I would like to plot the boxplots for the 7 columns. However, the second and third columns have the same name 'B'. How can I have ...
0
votes
1
answer
80
views
Matplotlib's boxplot does not use numeric x values and therefore uses too many ticks
when using boxplot with matplotlib , I wouldlike to have the x ticks to adapt to the figure size, so that the x-axis is not completely unreadable
Example
import numpy as np
import matplotlib.pyplot as ...
1
vote
3
answers
138
views
How do I easily find boxplot outliers
Below is an example using the mtcars dataset. There is one outlier with a value of 33.9, but I want a function that finds all of them for a given column.
library(dplyr)
library(ggplot2)
mtcars %>%
...
0
votes
1
answer
134
views
Boxplot with mean and variance
I have a intersection data with intersection id, number of vehicles in low and high traffic based in intersection id. So basically three values- intersection id, vehicles in low traffic and vehicles ...
1
vote
1
answer
61
views
boxplot two rasters and one shapefile
The code works with one raster and one shapefile. I tried to expand the code to use stack() for the two rasterfiles (present and future climate, paired boxplots), because extract(r,v) is available for ...
0
votes
1
answer
34
views
Plotly highlight function highlighting incorrect boxplots
While my cursor above the boxplots displays the correct statistics, the higlight function can only highlight one of the boxes and doesn't work correctly. Wherever I click, the leftmost box is ...
0
votes
1
answer
48
views
Confused on how to create a boxplot with percentages
I'm trying to create a side by side boxplot between two columns 'Total' and 'Region'. All dtypes are "object" however I stripped the '%' from the values in 'Total' and typecasted the column ...
0
votes
1
answer
101
views
boxplot of raster and shapefile
This example code works
library(raster)
library(sp)
library(rgdal)
library(ggplot2)
# Create some sample raster data
raster_file <- raster(ncol=36, nrow=18)
raster_file[] <- 1:ncell(raster_file)...
0
votes
1
answer
107
views
colouring lines around plotly box plot
I am creating a grouped boxplot in plotly using predefined quantiles. I want to color the lines around the boxes based on a separate variable. I can't seem to do this directly in my plotly call. There ...
1
vote
1
answer
90
views
plotly grouped barplot: how to specify quartiles but showoutliers
I am creating a grouped boxplot using plotly. I have to specify the quanitles because I have a specific way of calculating them. I also want to add the outliers to the plot as with standard behavior ...
1
vote
2
answers
58
views
Cannot plot scatter points on top of box plot in plotly using R
I am trying to plot scatter data on top of a box plot using Plotly. For this case I need to specify the quantiles manually. When I run the reprex below I get this error
Error in eval(expr, data, ...
0
votes
2
answers
131
views
how to add p value or significance after facet_nested used in ggplot2 boxplot
I met a issue and I didn't know where was wrong with my data or how to deal with it.
here is my data and script for drawing a boxplot with facets by ggplot2.
library(gtools)
library(ggplot2)
library(...