Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

add colorbar to 2d hist

fig, ax = plt.subplots()
h = ax.hist2d(x, y, bins=40, norm=LogNorm())
fig.colorbar(h[3], ax=ax)
Comment

add colorbar to 2d hist


from matplotlib.colors import LogNorm
import matplotlib.pyplot as plt
import numpy as np

# normal distribution center at x=0 and y=5
x = np.random.randn(100000)
y = np.random.randn(100000) + 5

fig, ax = plt.subplots()
h = ax.hist2d(x, y, bins=40, norm=LogNorm())
fig.colorbar(h[3], ax=ax)

Comment

PREVIOUS NEXT
Code Example
Python :: English Dictionary labels 
Python :: can we use python functions in node 
Python :: when was python 3.7 released 
Python :: pandas to latex table width pylatex 
Python :: can we pickle pyspark dataframe using python 
Python :: matrix outer product python 
Python :: sum of ele in arr 
Python :: ** (ArgumentError) lists in Phoenix.HTML and templates may only contain integers representing bytes, binaries or other lists, got invalid entry: 
Python :: astype oandas 
Python :: This line is compulsory to add anytime you want to use the Pygame library. It must be added before any other pygame function, else an initialization error may occur. 
Python :: python thunks 
Python :: PEP 428: The pathlib module – object-oriented filesystem paths. 
Python :: if condition python with index 
Python :: chrome crushs in selenium 
Python :: find index corresponding to maximum value pandas 
Python :: discord.py find user by name 
Python :: interval time specification 
Python :: how to make a tuple 
Python :: to the power python markdown 
Python :: algorithme permettant de passer au negatif une image 
Python :: Python - Cómo comprobar si dos cuerdas son anagramas 
Python :: how to fetch only the columns from a datframe which has a particular datatype 
Python :: deezer python download 
Python :: Flask migration method, see the artcle for more info 
Python :: sonido sfr200a 
Python :: jinja 2 iterate over dictionary 
Python :: wait until exe terminates python 
Python :: tensorflow tf.constant 
Python :: django app directory 
Python :: matplotlib set dpi 300 
ADD CONTENT
Topic
Content
Source link
Name
3+4 =