Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

shrink colorbar matplotlib

import matplotlib.pyplot as plt
from mpl_toolkits.axes_grid1 import make_axes_locatable
import numpy as np
    
plt.figure()
ax = plt.gca()
im = ax.imshow(np.arange(100).reshape((10,10)))
    
# create an axes on the right side of ax. The width of cax will be 5%
# of ax and the padding between cax and ax will be fixed at 0.05 inch.
divider = make_axes_locatable(ax)
cax = divider.append_axes("right", size="5%", pad=0.05)
   
plt.colorbar(im, cax=cax)
Comment

PREVIOUS NEXT
Code Example
Python :: count number of objects django template 
Python :: dataframe multiindex 
Python :: hist pandas 
Python :: django model query join 
Python :: python extract all characters from string before a character 
Python :: python fill string with spaces to length 
Python :: python ceiling division 
Python :: palindrome words python 
Python :: from pandas to dictionary 
Python :: sqlite3.ProgrammingError: Incorrect number of bindings supplied. The current statement uses 1, and there are 7 supplied. 
Python :: python string encode 
Python :: print format round python 
Python :: #adding new str to set in python 
Python :: inconsistent use of tabs and spaces in indentation 
Python :: pandas dataframe caption 
Python :: python clear stdout 
Python :: twitter api python 
Python :: class inside class python 
Python :: python json check if key exist 
Python :: python sort by highest number 
Python :: how to add zeros in front of numbers in pandas 
Python :: python regex find 
Python :: linkedin api with python 
Python :: pandas split list in column to rows 
Python :: django loginview 
Python :: django generate openapi schema command line 
Python :: function with args* example 
Python :: python merge two array into one 
Python :: 2d array row and column index 
Python :: kmp algorithm 
ADD CONTENT
Topic
Content
Source link
Name
7+3 =