Questions tagged [histogram]
In statistics, a histogram is a graphical representation, showing a visual impression of the distribution of data.
6,713
questions
0
votes
1
answer
35
views
How to produce barplot in bins?
I produce a barplot like this:
sns.barplot(data=number_counts, x="number", y="counts")
number_counts is a dataframe that looks like this:
number counts
1 7
2 8
3 10
4 12
5 14
6 9
...
0
votes
3
answers
43
views
How to add bar labels to a histogram on Matplotlib? [duplicate]
Using the Fifa 19 dataset, I'm trying to place the number of players within specific skill score intervals as labels on a histogram graph.
I'm reading the CSV file locally, although I put the URL link ...
1
vote
2
answers
31
views
R GGplot histograms and density with multiple fill variables
I want to create a plot with three overlapping histograms (each with a different color and semi-transparent) with their density polygons overlaid on the same graph without having the histograms ...
1
vote
0
answers
14
views
Tableau: Create histogram bins using calculated field
I am trying to create a histogram on Tableau using a calculated field but I am unable to do so.
The following are the relevant dimensions & measures in my data source:
Dimension(s):
Customer Name
...
2
votes
1
answer
41
views
Creating an (Intervals) Frequency Table Histogram
I have the following frequency table of intervals:
Height (inches)
Class Mark
Frequency
0–10
5
5
10–20
15
18
20–30
25
12
30–40
35
6
40–50
45
9
For which I tried to create a histogram using the ...
0
votes
0
answers
19
views
R: How to ensure both the bins and an overlaid function are both plotted on a histogram in r? [closed]
In r, I want to overlay an estimated density function on my histogram using the hist function. The problem is that it is neither a guarantee that the max bin height will be greater or lower than the ...
0
votes
0
answers
16
views
Generate frequency plot of a column containing multiple character strings
I want to generate a frequency plot of multiple character strings separated by semicolon that Excel has generated a single column of 315 responses.
Link to table
I have 19 different character string ...
0
votes
1
answer
78
views
histogram, bars in x axis cant be seen
I am trying to do the following plot, the plot is an histogram with several bars for two groups.
My approach:
library(ggplot2)
library(dplyr)
graph2 |>
filter(!is.na(healthy)) |>
ggplot(aes(...
0
votes
2
answers
78
views
Why are histograms incorrectly displayed when the distribution is tightly clustered? [duplicate]
I'm trying to display some data in a histogram, but when the data is too tightly clustered, I get either an empty graph, or one I believe to be inaccurate.
Consider the following code:
import numpy as ...
0
votes
1
answer
26
views
How to plot days data on top of month data in R
I have date data in R that lists specific dates across 11 months, that looks something like this (except I have many more data points):
Intake.Date = c("2023-01-26", "2023-01-26", &...
0
votes
0
answers
12
views
Adjusting numbers in a list based on constraints
I have a list of numbers and confidences in this numbers, for ex.
[(24, 0.2), (23, 0.3), (21, 0.3), (19, 0.1), (18, 0.15), (18, 0.2), (17, 0.3), (13, 0.3), (12, 0.2), (12, 0.3), (11, 0.2), (11, 0.1), (...
0
votes
2
answers
30
views
Creating Histogram from describe() data
How would I create a histogram directly from the mean samples generated by the describe() function on my data file? I appreciate the help.
I can't seem to figure out how to pull that certain row of ...
0
votes
0
answers
21
views
Usig R to create a histogram with density curve using precalculated counts and bins
This is my first post and I'm a real newbie to coding so forgive me if this isn't the most concise question.
I am trying to plot a histogram of pixel intensities for 3 different groups as an overlay ...
0
votes
1
answer
40
views
how to plot a histogram with a certain column(english_score) for a certain row of a column(group a) and set the number of bins to 20
I have a data set which I had to turned into a data frame. these data frame has 5 columns( sex, group, course, english score, final_score) the column group has 5 unique groups(group a, group b.......
0
votes
1
answer
42
views
How do I get data from several files in one histogram? [duplicate]
For a data analysis, I display the data from the individual folders in individual histograms. In order to get a better overview of the scatter of the measured values, I would now like to display all ...
-1
votes
1
answer
39
views
Word count histogram
I want to make a program that read a paragraph in a .txt file, the function needs to count the length of each word and add the number of words with same length into corresponding frequency. For ...
0
votes
1
answer
52
views
How to add images to the histogram using ggpattern?
I'm trying to add images to a histogram using ggpattern but I can't seem to get it to work.
library(ggplot2)
library(ggpattern)
image_paths <- c("img1.png", "20190530153216.png"...
1
vote
1
answer
48
views
How to add images to each bar of the bar chart in r?
I've tried to ggpattern to get the images to display in the bars, but it doesn't seem to work. The images do not display. Instead, the color of the bars is just grey.
library(ggplot2)
library(...
0
votes
0
answers
18
views
Align bins vertically with stat_histinterval
I am trying to create a faceted plot showing multiple group density distributions and histograms in the same facet, but I'm having trouble customizing the bins on the histograms, which were created ...
0
votes
1
answer
56
views
Is it possible to render a histogram without vertical line artifacts? [duplicate]
As can be seen in the screenshot below, I have plotted a histogram with Matplotlib. On close inspection it can be seen that there are slight vertical line artifacts.
There could be a number of causes.
...
0
votes
0
answers
19
views
Getting error when using variable_width_histogram aggregation 'Too many buckets'
We are trying to execute a query to get variable_width_histogram aggregation results but getting an error 'Trying to create too many buckets'. However bucket size in query is 10. When trying to get ...
0
votes
1
answer
21
views
PowerBI - Why am I unable to create bins for this calculated column?
I currently have the following formula behind a calculated column:
Relative Error =
VAR ActualValue =
CALCULATE(
SUM(Table1[Value]),
FILTER(Table1, Table1[Date] = EARLIER(Table1[...
0
votes
0
answers
27
views
Add normal distribution line to plot_histogram() [duplicate]
I plottet all my data with plot_histogram() to a facet grid, where each column(=each factor I am considering in my study) is shown in one plot.
X-axis is the value itself, Y axis is the frequency how ...
0
votes
0
answers
53
views
Plotting discrete densities using ggplot2 and stats::density
I was toying around with plotting empirical probabilities of discrete data using ggplot2; I am computing the probabilities for data in a vector x by hand using the table(x)/length(x) and using ...
-1
votes
0
answers
56
views
How to use different colours for categories in seaborn facetgrid with multiple histplots
I am trying to plot a long series of histograms in one row to look for trends. The data is hourly wind speed at a location for each July for the years 1980 to 2022. The raw data is wind speed in knots,...
0
votes
0
answers
9
views
Compute histogram for CVPixelBuffer using vImage
I have CVPixelBuffers in YCbCr (422 or 420 biplanar 10 bit video range) coming from camera. I see vImage framework is sophisticated enough to handle a variety of image formats (including pixel buffers ...
0
votes
2
answers
47
views
Aligning ticks of primary and secondary x-axes
I am trying to align the ticks of the primary and secondary x-axes in my plot. The values in my absolute_mags and masses arrays should be equivalent, but are not lining up properly. The offset in the ...
0
votes
1
answer
42
views
Add a line to a histogram to show the power law distribution in julia
I have a value and plot a histogram like this (log-log scale):
The code for the histogram is as follows:
histogram(log.(degree), bins=50, yaxis = (:log10))
title!("Degree distribution (log-log ...
0
votes
1
answer
36
views
Histogram with two y-axis 'count' and 'percentage' in bokeh?
I am new to bokeh. What is the clean way of creating a histogram of the data in bokeh, with two y-axis one is "count" and one is "percentage"? I used quad to create the histogram ...
0
votes
0
answers
22
views
How to visualize a prometheus histogram metric as a normal histogram instead of a cumulative historgram in grafana
I am trying to visualize a histogram metric which I pushed to prometheus micrometer using below code.
import io.micrometer.core.instrument.Timer;
public void logHistogramMetric(String metricName, ...
1
vote
1
answer
45
views
How to add a second x-axis which labels standard deviations from mean to a histogram in R?
I am unsure of how to add a second set of axis labels for the number of standard deviations the confidence intervals are from the mean.
I would like it to look like the example in the image below, ...
0
votes
1
answer
66
views
Base R hist() function generates histograms with incorrect frequencies
I'm new to R and am trying to generate simple histograms for presentation to students. I've simulated a dataset with 10 variables, five of which contain negative values and five of which contain ...
0
votes
1
answer
29
views
Add another plot on top of a histogram plot
I am using Plotly Express to plot two histograms. First one is just plotting the distribution of car ads and the number of miles they've run. The second is for the same bins as the miles, I am ...
0
votes
0
answers
19
views
Power-Bi plot in multiple layers
I need help in Power-Bi plot.
I have a dataset consists of 2 columns, named col1 , col2
col1 | col2
1 | a
1 | b
1 | a
2 | a
2 | c
Now, I draw a chart which shows ...
0
votes
1
answer
34
views
Plotting population pyramid consisting of probability density in Python
I am trying to plot a population pyramid like this. However, I don't just want the histograms, I want probability densities as well (the sum of the densities should be 1). When I plot them separately ...
0
votes
0
answers
41
views
Vertical and multiple histograms with ggplot
Is there a package or code to make this graphic (https://i.stack.imgur.com/hOc7F.png) with ggplot?
I know there's a way with facet_grid, but I need it to be one graphic, not a facet.
I also know I ...
2
votes
1
answer
107
views
Wrong values in System.Diagnostics.Metrics.Histogram buckets
I'm learning telemetry metrics for sending them to Prometheus.
I wrote a C# console application (.NET 7).
I want to meter the ping time and save values to a histogram with custom boundaries.
Here is a ...
1
vote
0
answers
28
views
Huge plotly html
I've this simple plotly python script:
import plotly.express as px
import numpy as np
s = np.random.normal(0., 1., 100000)
fig = px.histogram(s, nbins=7)
fig.write_html('fig.html', include_plotlyjs='...
0
votes
1
answer
48
views
Add transparent histogram outline using relative frequency
In ggplot2, I'm trying to compare two distributions, one using a filled in histogram, and the other using the outline of a histogram. The goal is to show a relative frequency histogram here, not ...
1
vote
1
answer
101
views
Grouping in assigning colors to plotly histogram
I am trying to get started with using Dash and I have a simple problem. I have a data table
Index, Product, Customer_Age, Revenue
1, A, 12, 10
2, B, 99, 12
and so on.
I want to plot the revenue per ...
0
votes
0
answers
15
views
Issue of replicating a weighted dataset using np.hist
I have a problem where I'm trying to emulate a weighted data set, and when I use np.hist including weights as an input I get a massive discrepancy. Here's the plot of that: histograms with weights
...
0
votes
0
answers
44
views
Promethus/Grafana Histogram_quantile never shows data from le="+inf" bucket
I'm trying to understand how many requests are served in over 10s for a service. To get a sense of the latency distribution overall, I look at the Heatmap in Grafana for this query.
(sum by (le) (...
0
votes
0
answers
25
views
ggplot- multiple histograms, need them to be in a chronological order [duplicate]
I am trying to display 16 individual histograms. I am able to create the unique histograms, but I want them to display in order of site elevation, from lowest elevation to highest.
Temp by site
...
1
vote
1
answer
100
views
Plot Histogram of the sum of values for each month [duplicate]
Plot Histogram for confirmed COVID 19 Cases Dataset where date needs to be on x-axis vs confirmed covid 19 cases on y-axis
I want to plot month i.e.,FEB 2020,MAR 2020 on x-axis vs confirmed covid 19 ...
0
votes
0
answers
41
views
My RStudio ggplot2 Histogram Looks Like a Box
I'm new to R (as you can probably tell). My problem is that when I used the following function to make a histogram:
fig1 <- ggplot(datos1, aes (x = peso_semilla)) +
geom_histogram ()
R tells me ...
0
votes
1
answer
27
views
numpy histogram stop producing bins that have no values in it
I have an array that numpy.histogram binning no values into some bins, when I specified bins=5. I would like the values to be binned so that no bin is left empty.
How can I achieve this?
-1
votes
1
answer
121
views
How to pass histogram bins for each discrete value in 2D histogram and plot it
My data can be seen as a time series. For t=0 there is some data x0, then for t=1 some data x1, etc. I am trying to create a 2D histogram using sns.histplot here for reference of this data. I want to ...
0
votes
1
answer
26
views
How to set specific intervals in histogram plots in R?
I want to plot a histogram with a binwidth of 4. I am not able to fix the intervals of these data. I want my bins to start from x = 28 and have intervals of 4 from there on. For ex - 28-32, 32-36, 36-...
0
votes
0
answers
46
views
3D Gnuplot box plot with individual bars made up of different colors
I want to create a 3D Gnuplot box plot with different colors within an individual bar. (See example below). Is it possible in Gnuplot to create a box plot where I can specify multiple colors for ...
0
votes
1
answer
37
views
Numpy Error when trying to plot a histogram
I am trying to plot a histogram with this code. Python is giving me an error in line 1.
numpy.genfromtxt('dataset1.txt', dtype=<type 'float'>,
comments='#', delimiter=None, skip_header=0,
...