Questions tagged [histogram2d]
131 questions
0
votes
1 answer
2d Polar Histogram with python
I am trying to do a 2d polar histogram. my data are 2 np.arrays:
azim = [azimuth angles -180 to +180 degrees]
zenith = [zenith angles 0 to 90 degrees]
This is the code i have so far :
# define binning
rbins = np.linspace(0, 90,10)
abins =…

Konstantina
- 45
- 4
0
votes
0 answers
How to get x,y coordinates from an image for generating heatmaps (python)
I am a programming beginner. I am using images and I want to analyse them with simple codes (for the beginning).
I have images (JPEG files) with black points on a white background. I would like to create a heatmap or a dense map to identify regions…

Tapsi
- 39
- 1
- 4
0
votes
2 answers
2d histogram: Get result of full nbins x nbins
I am using matplotlib's hist2d function to make a 2d histogram of data that I have, however I am having trouble interpreting the result.
Here is the plot I have:
This was created using the line:
hist = plt.hist2d(X, Y, (160,160),…

GeoMonkey
- 1,615
- 7
- 28
- 56
0
votes
1 answer
data shader change color for each date
For a scatterplot with datashader I want to incorporate the notion of time into the plot. Potentially by using color.
Currently,
import numpy as np
import pandas as pd
import seaborn as sns
date_values = ['2020-01-01', '2020-01-02', '2020-01-03',…

Georg Heiler
- 16,916
- 36
- 162
- 292
0
votes
0 answers
Efficiently compute 2D histogram with Pyspark (Numpy and UDF)
I'm trying to do something really simple which somehow translates into something really difficult when Pyspark is involved.
I have a really large dataframe (~2B rows) on our platform which I'm not allowed to download but only analyse using Pyspark…

Droid
- 441
- 1
- 3
- 18
0
votes
2 answers
How do I find the bin with the highest count using np.hist2D()
Is there a way to find the bin with the highest count from np.hist2D().
My code so far is:
counts, xedges, yedges = np.histogram2d(x,y bins=100) # x and y are two lists of numbers
print (len(counts), len(xedges), len(yedges)) # 100 101 101
I…

startswithH
- 309
- 4
- 14
0
votes
1 answer
Cannot get a SIMPLE HISTOGRAM to plot in Python 3.7 Notebook
Below is the error code I received as I am trying to do a Histogram from the DF "code" and the column ("Age")
code['Age'].plt.hist()
1
code['Age'].plt.hist()
---------------------------------------------------------------------------
AttributeError …

Your Training Expert
- 17
- 5
0
votes
2 answers
Controlling scatterhist Marker Transparency
I need to control the transparency of the markers in the figure produced with the scatterhist command in MATLAB.
The following post is helpful in handling the color of the histograms: Controlling scatterhist bar colors.
How can the transparency…

Oliver Amundsen
- 1,491
- 2
- 21
- 40
0
votes
1 answer
NumPy histogram2d with a rotated, non-orthogonal binning grid
I need to compute (and plot) a histogram2d but my binning grid is rotated and also non-orthogonal.
A way of doing this could be to apply a transformation to my data so I get it into a cartesian system, compute my histogram2d and then apply the…

YeO
- 938
- 1
- 9
- 17
0
votes
1 answer
How to reduce the width of histogram?
I have drawn histogram of a diagnosis, which I modeled as poisson distribution in python. I need to reduce the width of rectangle in output graph.
I have written following line in python. I need to width reduction parameter to this code line.
fig =…

YatShan
- 425
- 2
- 8
- 22
0
votes
2 answers
How to Draw a COLZ TH2F from a TTree?
I am trying to draw a COLZ plot i.e. a 2D histogram with a colour bar, from a Tree, and be able to define the number of bins myself.
My Tree is called event:
I have tried:
event->Draw("x:y>>hist1(1000,100,500,1000,0,500)", "x>100");
TH2F * hist1 =…

Oceanescence
- 1,967
- 3
- 18
- 28
0
votes
0 answers
Strange "counts" matrix from matplotlib.pyplot.hist2d
I would like to get the 2d numpy array from the 2dhist function. After obtaining the counts, I would like to plot the data in the pyplot.imshow() function to further add some information. The integers that are allowed to appear in my list are…

user3554329
- 111
- 2
- 11
0
votes
0 answers
Python + Add Contour Lines of Percentiles to a 2D Histogram
I have a code (see below) to plot a density scatter plot (2D histogram).
I would now like to add contour lines representing 7 selected percentiles (5%, 10%, 25%, 50%, 75%, 90%, 95%) of the number of data.
I have been googling solutions for too long…

kirerik
- 167
- 1
- 15
0
votes
1 answer
How to smooth or overlap bins in pyplot.hist2d?
I am plotting a 2D histogram to show, for example, the concentration of lightnings (given by their position registered in longitude and latitude). The number of data points is not too large (53) and the result is too coarse. Here is a picture of the…

Cristian FL
- 143
- 3
- 9
0
votes
1 answer
Issue with axes scaling when applying a filter to plt.imshow
I am trying to apply a gaussian filter to a 2dhistogram but the y-scale isn't fitting properly when I use my input data.
If I run an example dataset it works fine. This is an example using random data.
import matplotlib.pyplot as plt
import…
user9394674