Questions tagged [histogram2d]

131 questions
0
votes
1 answer

How to convert edge-values of a 3d histogram into mid-point values of the histogram?

If hist, (x, y, z) = numpy.histogramdd() gives you the histogram values at positions (x, y, z) corresponding to the edges of the bins for a three-dimensional function, how one can calculate (interpolate) the histogram values at midpoints namely…
Rebel
  • 472
  • 8
  • 25
0
votes
1 answer

How to isolate regions of a 3d surface with a constrained height?

I have a 2-variable discrete function represented in the form of a tuple through the following line of code: hist_values, hist_x, hist_y = np.histogram2d() Where you can think of a non-smooth 3d surface with hist_values being the height of the…
Rebel
  • 472
  • 8
  • 25
0
votes
0 answers

2d histogram with equal number of points in each bin

I would like to use binned_statistic_2d (from scipy) on my dataset, but with custom bin edges calculated so that in every bin there is an equal number of points. I tried to modify code from user farenorth for 2d dataset, but I'm beginner in python,…
elizevin
  • 101
  • 1
  • 9
0
votes
1 answer

ValueError: too many values to unpack (expected 2) when plotting a 2dhistogram

I am trying to plot a hist2d from a list of x,y coordinates but get a Value Error: too many values to unpack (expected 2). The code is: visuals = [[],[],[]] with open('Wide_Single_timestamp2.csv') as csvfile : readCSV = csv.reader(csvfile,…
Chopin
  • 96
  • 1
  • 10
  • 35
0
votes
1 answer

numpy 2D Histogram

When I run: hist_2d_i = np.histogram2d(df.feature1.iloc[0], df.feature2.iloc[0], bins=\ [binsx, binsy],weights=df.weights.iloc[0]) I get an error: The dimension of bins must be equal to the dimension of the sample x. But if I run: hist_2d_i =…
user7867665
  • 852
  • 7
  • 25
0
votes
0 answers

Create a C++ implementation of Matlab histcounts function

I want to program a function in C++ which does the same thing as the function histcounts in Matlab, but I don't get the right edges. [V, edges]=histcounts(Vector,10); I found this post : implementing matlab hist() in c++ and I created a function…
0
votes
0 answers

histogram2d heatmap manipulation

I created a heatmap from a scatterplot of csv values using the code i found from a different stackoverflow thread here Generate a heatmap in MatPlotLib using a scatter data set This works but I'd like to edit the colours/smooth between bins etc.…
erb
  • 11
  • 3
0
votes
0 answers

Histogram2D in python fails with ValueError

Possibly a duplicate of Pandas/Python: 2D histogram fails with value error. But the solution proposed there is not working for me. I am trying to use numpy histogram2d on 2 arrays each of size 55812. When I run the command np.histogram2d(x,y), I get…
deathracer
  • 305
  • 1
  • 20
0
votes
1 answer

Problems with computing the joint probability mass function with np.histogram2d

I currently have a 4024 by 10 array - where column 0 represent the 4024 different returns of stock 1, column 1 the 4024 returns of stock 2 and so on - for an assignment for my masters where I'm asked to compute the entropy and joint entropy of the…
Jayjay95
  • 199
  • 9
0
votes
1 answer

Access first two dimensions of N dimenional histogram

I generate an N-dimensional histogram via numpy's histogramdd, with dimensions varying between 2-5. I need to plot a 2-dimensional histogram of its first two dimensions, ie: When there's only two dimensions, I can do that easily as shown below. How…
Gabriel
  • 40,504
  • 73
  • 230
  • 404
0
votes
0 answers

Why am I getting wrong axis values when making a histogram2d?

As you can see, px and py are arrays that contain 100 numbers from 0 to 1. But nevertheless, in the plot generated, the axis range is wrong (from 0 to 100 instead of from 0 to 1), and this bothers me a lot because I need to plot several curves in…
0
votes
0 answers

Value error with numpy histogram

I have the following inputs: index_array array([ 2., 3., 4., 5., 6., 7., 8., 9., 10., 11.]) success_rate_array array([ 0.14436074, 0.15488785, 0.17158958, 0.19350282, 0.20358402, 0.21188935, 0.23390895, 0.26160338, …
helloB
  • 3,472
  • 10
  • 40
  • 87
0
votes
1 answer

Why Matplotlib plot the wrong heatmap in this case?

"m" is an GPS coordinates array defined in https://www.dropbox.com/s/vua4nakd8sz3ocy/data.py?dl=0 I can use the matplotlib function hist2d(zip(*m)[0],zip(*m)[1], bins=60, cmap='jet', normed=True) to produce the correct density heatmap. However, if…
tonny2v
  • 11
  • 1
0
votes
1 answer

2D histogram of events is misaligned with 1D bar charts of event probability x and y axes using python and matplotlib

I would like to plot a 2d histogram using matplotlib in order to visualize the influence of two variables on the occurrence of an event. In my test case, the event is “wish coming true” and the variable x is the number of falling stars and y is the…
0
votes
1 answer

How to compare two histograms of different bits

I have two histograms 200X200 of 8 bit image and one is 800X800 of 16-bit. How can I compare them? Is it even possible to compare them or not?
1 2 3
8
9