Questions tagged [histogram2d]

131 questions
1
vote
1 answer

Is there a way to bin a set of 2D coordinates in Python

Hey so I have a 2D array of x,y coordinates in the form: [[x0,y0],[x1,y1],....,[xn,yn]]. These coordinates lie within a rectangle of size x_length and y_length. I want to split the rectangle into a set of squares and find how many coordinates lie…
Adrien
  • 15
  • 4
1
vote
0 answers

How to align hexagons in geom_hex plots in ggplot2

I'm trying to combine two sources of data into one 2-dimensional hex plots so that they have the same registration (so the hexes from data set 1 align with the hexes from data set 1) and proper hex size when plotted. Alas, failure so…
Eden
  • 335
  • 2
  • 8
1
vote
1 answer

Reproducing a 2d histogram in Python

I'm working with a very large dataset in Python, so I'm trying to use histograms instead of arrays (the arrays get way too large for saving/loading/mapping). I'm crawling over a bunch of files and pulling information from them, and I would like to…
HEP N008
  • 187
  • 8
1
vote
1 answer

Combine two 2D Datasets in single bi-dimensional histogram matrix with shared scale

I have two datasets d1,d2 filled with 2D Data of different scale. import numpy as np d1 = np.random.normal(-30,20,(500,2)) d2 = np.random.normal(-40,10,(500,2)) Furthermore I am able to create separate 100 x 100 2D Histograms (=gray scale images)…
gustavz
  • 2,964
  • 3
  • 25
  • 47
1
vote
1 answer

problem in reading and plotting sampled data using historgram2d

I have some data and want to read the 5th and 6th column so to plot the 2D histogram of it. I have written the following code but it fails. I would be appreciated if someone can help me in this process. import numpy as np import pandas as pd import…
Anonymous
  • 83
  • 5
1
vote
0 answers

Counting Number of Rectangles in a 2d histogram with area >=K

The problem is in a 2d histogram with N columns, counting number of rectangles with area ≥ K. The columns have width 1 and I know the number of unit squares on the ith column. I've come up with the following O(N²) algorithm: let hi be the height of…
Kai Wang
  • 133
  • 5
1
vote
0 answers

Colorgradient not displaying properly on StatsPlots corrplot

I am trying to obtain a corrplot of some three-dimensional data array using Julia. The StatsPlots documentation includes the following example of a corrplot: M = randn(1000,4) M[:,2] .+= 0.8sqrt.(abs.(M[:,1])) .- 0.5M[:,3] .+ 5 M[:,3] .-=…
Bremsstrahlung
  • 686
  • 1
  • 9
  • 23
1
vote
1 answer

How to center bin labels in matplotlib 2d histogram?

How can I center my bin labels in x and y for a matplotlib pyplot 2d histogram? I've tried the following: import numpy as np import matplotlib.pyplot as plt ns = np.random.uniform(low=0,high=6,size=200) dets =…
Adam G.
  • 75
  • 11
1
vote
2 answers

How to generate a 3D joint probability distribution for bivariate data (e.g., plotly)?

I have generated these data: dat = MASS::mvrnorm(n = 50, mu = c(1, 5), Sigma = matrix(c(1, 0.5, 0.5, 1), nrow = 2), empirical = TRUE) I can generate a 2D histogram with the following code: plot_ly(x…
grug
  • 33
  • 4
1
vote
1 answer

How do I make heatmap using scatter plot data from dataframe?

I have a dataframe that contains my x and y data (converted later into lists), and for each x,y I have three attributes that are percentages (all add up to 100%), so, for example, for x,y the first attribute is 0.05, the second is 0.45 and the third…
Haj Sai
  • 291
  • 3
  • 13
1
vote
1 answer

How to create a discrete 2d-Histogram plot

I am trying to plot a 2d histogram showing the correlation between the error codes received between two measurements. The error code values range from -3 to 5. I would like the histogram to show a bar for every error code. The bars should increase…
user3554329
  • 111
  • 2
  • 11
1
vote
0 answers

F# arrays to 2D histogram

I’m using OxyPlot with F#. I have code to create a single parameter histogram and plot it. My code for dual parameter histograms in the form of a contour is too time consuming. I’d like an efficient way to map two vectors or arrays into a 2D…
dgp
  • 13
  • 4
1
vote
1 answer

histogram2d example for bokeh

Surprisingly nobody took the pain to make an example in the bokeh gallery for 2D histogram plotting histogram2d of numpy gives the raw material, but would be nice to have an example as it happens for matplotlib Any idea for a short way to make…
Rho Phi
  • 1,182
  • 1
  • 12
  • 21
1
vote
1 answer

Create 2d histogram from a list of lists

I'm attempting to create a 2d histogram from two data arrays, one with a list with y value ranges (rdata) and other which is a nested list where the outer list gives the intensity at a specific time and the inner list givs the intensity at a…
JackLidge
  • 391
  • 4
  • 16
1
vote
0 answers

plotting contour with python

i plotted a density map with histograme2d and pcolomesh using a csv file containning lat/lon. Now i want to turn the histogram2d output into contours matplotlib. my code is as shown below: import csv import numpy as np from mpl_toolkits.basemap…
1 2 3
8 9