Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

Compute the 2d histogram of x and y.

import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline

xedges = [0, 1, 2, 3]
yedges = [0, 1, 2, 3, 4]
x = np.array([0, 0.1, 0.2, 1., 1.1, 2., 2.1])
y = np.array([0, 0.1, 0.2, 1., 1.1, 2., 3.3])

out = np.histogram2d(x, y, bins=(xedges, yedges))

plt.scatter(x, y)
plt.grid()
Comment

PREVIOUS NEXT
Code Example
Python :: open csv from url python 
Python :: python get zip file size 
Python :: fillna with median , mode and mean 
Python :: python global variable across files 
Python :: seir model python 
Python :: timer 1hr 
Python :: get dataframe column into a list 
Python :: loop indexing 
Python :: dir() in python 
Python :: python argparse optional required 
Python :: plt text matplotlib white background 
Python :: Matplotlib rotated x tick labels 
Python :: distplot in python 
Python :: python edit string variable 
Python :: match python 
Python :: how to change port in flask app 
Python :: pandas merge two columns from different dataframes 
Python :: capitalize first letter of each word python 
Python :: roblox api python 
Python :: python dunder 
Python :: python defaultdict(list) 
Python :: pd.merge remove duplicate columns 
Python :: udp socket python 
Python :: replace list python 
Python :: how to make a function in python 
Python :: python if string contains substring 
Python :: generate random integers in a range 
Python :: play music pygame 
Python :: python square a number 
Python :: circle circumference python 
ADD CONTENT
Topic
Content
Source link
Name
7+6 =