Questions tagged [histogram2d]
131 questions
0
votes
1 answer
many histograms in the same plot
This is my dataframe:
df <- data.frame(
confidence = c(0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1),
A = c(44615, 4767, 2035, 834, 374, 186, 86, 35, 9, 4, 4),
B = c(133995, 3059, 1152, 404, 164, 70, 33, 18, 2, 0, 0),
C = c(37998,…
0
votes
1 answer
NonUniformImage: numpy example gives 'cannot unpack non-iterable NoneType object' error 2D-Histogram
I'm trying to run this very simple example from numpy page regarding histogram2d:
https://numpy.org/doc/stable/reference/generated/numpy.histogram2d.html.
from matplotlib.image import NonUniformImage
import matplotlib.pyplot as plt
xedges = [0, 1,…

081N
- 35
- 4
0
votes
1 answer
How to get the values at the pixels of a bokeh image glyph in hover tool?
I have generated a bokeh 2d-histogram plot as mentioned in this StackOverflow answer. The code and respective image is given below. In the code, the count of data-points per bin is in the entries in H. How can I get access to an individual…

Anirban Chakraborty
- 539
- 1
- 5
- 15
0
votes
0 answers
Image and Kdeplot not matching
I'm trying to make a kdeplot graphic using some coordinates. Problem is that when I merge it with an image, the kdeplot rotates making it not to match the image. If I remove the line
plt.imshow(img)
The kdeplot shows the graphic correctly.
fig, ax…

mew
- 9
- 2
0
votes
0 answers
Probability Density Function in histogram2D
I've been working on a model to show the number (of people) in groups who walk by a certain point, and from which direction they come from.
I have data from 1994 up until 2020, with a time step of 10 minutes (a lot of data!)
After getting all the…
0
votes
0 answers
Normalize/proportionalize count of individual bins 2d histogram
I am trying to normalize the count of individual bins in a 2d histogram. Here, group 3 has a substantially higher number of inputs, however, I want to compare bins. So I am trying to get it to show the proportional y values of each bin, that the…

Maurice K
- 1
- 2
0
votes
1 answer
Vector weighting using matplotlib hist2d
I'm using a 3 dimensional dataset from a simulation. It contains the coordinates of some gaseous particles and their associated magnetic field vector. I'm trying to plot a 2D histogram of some region of this simulation, weighted in terms of the…
0
votes
1 answer
2D histogram plot not filling with base color in matplotlib ply.hist2d when axis limits are set (required)
I need my plots to completely fill with color. Adjusting xlim, ylim, only works works after, but it is apparently past the step where the plot is completely filled. In cases where data spans (0,360), (90,180), the fill is fine, but if the data is…

Josh
- 11
- 3
0
votes
0 answers
Rebinning a TH2 histogram from ROOT using uproot and then plot it with matplotlib
I am able to extract a TH2 histogram from ROOT using the h = f[...].to_numpy() of uproot.
This I can then plot with mplhep as a hist2dplot(h).
However, I have the problem that I would like to rebin the original histogram and then plot this. I could…

nyw
- 195
- 2
- 11
0
votes
1 answer
How do I create a 2D matrix with more than 30 bins?
I'm working on a code that takes a list of points from a text file and an input m, to create a frequency distribution of points where m is the number of bins.
discret = open('testingdisc.txt','w+')
x = []
y = []
m = int(input("Input number of…

Tuna
- 3
- 1
0
votes
1 answer
Compare different histogram2d binnings using the same edges
I have a dataset that looks like this:
tsne_results_x tsne_results_y team_id
0 -22.796648 -26.514051 107
1 11.985229 40.674446 107
2 -28.231720 -49.302216 107
3 31.942875 -14.427114 107
4 -46.436501 -7.750005 107
76 …

vftw
- 1,547
- 3
- 22
- 51
0
votes
1 answer
2D Histogram with weights on Tensorflow
I need to use a 2D Histogram with weights on Tensorflow. However, the only solution I found in here does not implements the weights argument such as in numpy implementation. Looking at the source code of numpy implementation, I was able to do the…

Lucas Kirsten
- 41
- 6
0
votes
1 answer
Converting time series data to gridded 3D array in python
I have a dataframe with the timeseries data for many years and includes values of variable at different lat lon locations every day. For a given day, the variable is recorded at different locations. Following is a snippet of the dataframe which I am…

Learning_datascience
- 79
- 9
0
votes
1 answer
Make a heatmap whit 2d points and 2 images
Good day to all,
I am trying to create a heatmap, given a set of x, y coordinate pairs extracted from a CSV file. I am using numpy.histogram2d to plot it, the heatmap gives me correct, but I need to overlay it on another image. I share my code
Here…
0
votes
1 answer
Creating a 2D image by logarithimal binning
I have a DataFrame consisting of two columns as follows:
col1 col2
0.33 4.33
0.21 4.89
3.2 18.78
6.22 0.05
6.0 2.1
... ...
... ...
Now I would like to create a 200 x 200 numpy array by binning both…

machinery
- 5,972
- 12
- 67
- 118