129 questions
1 vote
1 answer
92 views
Is there a way to reduce noise within this 2d numpy histogram by setting a minimum count limit to each bin?
I am working with a dataset and am trying to correlate 2 variables and use the third variable as a weight within a numpy 2d histogram. However, there is a lot of noise within the output histogram and ...
1 vote
0 answers
231 views
Mpltern hexbin and tribin ternary plots do not reflect actual data
I have some data that I want to plot as a ternary hexbin or tribin plot. When I plot it using a scatter plot, it looks like I expect it to. Here is the scatter plot of the data I expect to see. ax....
0 votes
1 answer
37 views
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, ...
1 vote
1 answer
550 views
histogram of Bivariate Normal distribution and pdf on Matlab
I have values from a Monte Carlo simulation. now I am supposed to plot the results using a bivariate Gaussian. Since it is experimental data on a specific topic, I was given the empirical formula of ...
2 votes
1 answer
319 views
How can I generate 2D histogram with my customized bins?
I am a physicist studying about super-galactic objects and I feel like it is difficult to make 2D histogram based on what I want to make. To avoid confusion and getting answer what I already know. I ...
1 vote
0 answers
17 views
Python and matlab, hist3 and histogram2d difference [duplicate]
I am writing a Python version of a Matlab program that does 2D histogram. I am making a program that calculates a histogram using the hist3 function in Matlab. And in Python I use the numpy function ...
2 votes
2 answers
327 views
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 ...
1 vote
0 answers
152 views
Histogram 2d Visualization
I'm testing plotly.js 2D Histogram contour to show the pressures of a foot, but it changes a lot the shape and it doesn't look like a foot pressure. There is the Codepen to test it, as you can see ...
1 vote
0 answers
137 views
How to 2d bin in histogram python
I m a student and I m in a huge trouble, I am trying to visualize a plot of 2 variables x and y the number of data points in x and y are like 100 thousand or similar and the data in is float and ...
0 votes
1 answer
305 views
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....
1 vote
1 answer
443 views
How to define custom function for scipy's binned_statistic_2d?
The documentation for scipy's binned_statistic_2d function gives an example for a 2D histogram: from scipy import stats x = [0.1, 0.1, 0.1, 0.6] y = [2.1, 2.6, 2.1, 2.1] binx = [0.0, 0.5, 1.0] biny = [...
0 votes
1 answer
156 views
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 ...
0 votes
1 answer
967 views
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), (...
2 votes
1 answer
6k views
Get center of bins histograms python
I'm using the hist2d function of matplotlib.pyplot, giving it input some coordinates (x,y). I would like, after having defined the histogram, to get the center of each bin, i.e., the coordinates of ...
0 votes
0 answers
804 views
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 ...