6,787 questions
3
votes
2
answers
155
views
Struggling to make histogram density curve [duplicate]
I am very new to coding and R but I am trying to make a series of superimposed histograms with density curves in ggplot2. I have trawled through the forum for similar threads but because I am so new, ...
0
votes
1
answer
61
views
How can I create two 2D Histograms in a single figure with one colorbar?
I am looking to create a figure that has has two 2D histograms in a row with a single colorbar. I can create each 2D histogram individually, but when I attempt to put them side by side things go ...
3
votes
1
answer
66
views
Error "x must be numeric" on numeric variables when using histBy()
I'm trying to draw histograms of a DV (minutes) for each level of the IV (group) using the histBy function in the {psych} package.
My dataset contains 3 variables, all of which are numeric. There are ...
2
votes
1
answer
50
views
Density histogram with different fill colours
I'm looking to create a density histogram (i.e. histogram with density, not counts, on y-axis), with certain portions of the histogram coloured according to categories. Here's a simple example:
...
4
votes
2
answers
70
views
Delta/Difference Histogram
Minimum working example:
import pandas as pd
import plotly.graph_objects as go
# Example data
data = {
"data-a": [10, 15, 10, 20, 25, 30, 15, 10, 20, 25],
"data-b": [12, ...
1
vote
2
answers
93
views
Adding vertical lines to histogram plot
I have the following code to plot a histogram in Python:
fig.add_trace(go.Histogram(x = df["error"], showlegend = False))
This results into a histogram similar to:
Now I want to add 2 ...
2
votes
1
answer
40
views
Seaborn histogram to plot survey answer frequency by gender
I have some survey question answers (letters A, B, C) I'd like to plot in a Seaborn histogram, with the frequency of each response letter grouped by gender.
import pandas as pd
answers = ['A', 'B', 'A'...
1
vote
0
answers
43
views
GGridges Gradient Fill [duplicate]
I'm using this data to try to plot multiple histograms showing political polarization in Congress over the years (dwnom1). I can get the multiple histogram with ggridges, but everytime I try to apply ...
0
votes
0
answers
24
views
Creating seaborn histplot with dates instead of data's default dates
I'm wanting to format this histplot in seaborn so that it includes the date range for the entire dataset I have, not just the range in which this variable occurs. Histplot with code above, shows data ...
1
vote
1
answer
119
views
Why does keyword argument 'weights' not work when calling NumPy histogram in Numba?
This Python 3.13.5 script with numpy 2.2.6 and numba 0.61.2:
import numpy as np, numba as nb
@nb.njit(fastmath=True)
def f(a, b):
return np.histogram(a, 10, weights=b)
a = np.random.randint(0, 256,...
3
votes
1
answer
106
views
Why does the last bin in a NumPy histogram have an unusually high count?
This Python 3.12.7 script with numpy 2.2.4:
import numpy as np
a = np.random.randint(0, 256, (500, 500)).astype(np.uint8)
counts, bins = np.histogram(a, range(0, 255, 25))
print(np.column_stack((...
0
votes
0
answers
30
views
Multiple imputation with mice: Auxiliary variables excluded (loggedEvents, method = "pmm")
I am working with an ecological dataset where I need to impute missing values for 11 variables of interest (species'traits) using mice package.
To support the imputation of NMAR traits, I included ~...
-1
votes
1
answer
31
views
How to calculate histograms of density of images for each RGB channels?
How can I plot normalized histograms for the red, green, and blue channels of an image using Matplotlib, displaying them with partial transparency and labels in a single figure?
How can I also ...
0
votes
1
answer
29
views
with Highcharts why is the x-axis label not in the center of the bar
I have this chart hosted on jsfiddle:https://jsfiddle.net/81wbcsaq/4/
The first label 0-2.50 must be in the center of the first bar so a more to the right.
highcharts
In this image the label of the ...
2
votes
1
answer
40
views
Renaming automatic aggregation name for density heatmaps / 2d histograms
When creating density heatmaps / 2d histograms, there is an automatic aggregation that can take place, which also sets the name as it appears on the legend. I'm trying to change how that aggregation ...